> Writing UI as pure functions of state feels far more natural
That makes sense, but that's not what react does. Components are functions of their "prop"s. The rest of the state comes from a memoized cache in a fiber. Which fiber? That's determined from a reconciliation algorithm. Does it do the right thing? Usually.
You can tell if it's "a function of state" by whether the state is in the parameter list.
That makes sense, but that's not what react does. Components are functions of their "prop"s. The rest of the state comes from a memoized cache in a fiber. Which fiber? That's determined from a reconciliation algorithm. Does it do the right thing? Usually.
You can tell if it's "a function of state" by whether the state is in the parameter list.