← inworld.help

state across the screen

2025-01-08 · apprenticeship · 3 min · inworld.help

tài 🧠
state, n. — the condition of a thing at a given time; how it stands.
态:名词。事物在某一时刻的状况,它所处的样子。

the typescript turn led somewhere i hadn't expected: react, and the question of state. a web page that does more than sit still has to keep track of what's true right now — what's typed, what's shown, what's changed. react made that the whole center of gravity

state and props

the notes walked the pieces plainly. props pass data into a component, one way down. state lives where it changes. a component holds what it knows and re-renders when that knowledge moves. the same ownership instinct i kept finding everywhere — the thing that owns a piece of truth is the thing that gets to change it

redux, the single store

then redux, which took the idea further. instead of state scattered across components, one single store holds the whole truth of the app, and components read from it. react-redux wired the two together. async actions meant a component could ask for something and update when the answer finally came — the async discipline from the warp servers, now on the client side of the screen

态 is state. the web turn taught me the net; the react turn taught me to hold its truth in one place. the whole idea — one store of truth, read everywhere — would come back again, bigger, when i needed to control a fleet instead of a page