evolution of a #react app
evolution of a #react app
Replies
each component maintains its own state
child component does something that affects a parent or sibling so a setter function needs to be passed down from the parent to manipulate that parent's state so that the sybling can pull it from that common ancestor.
parent or sibling changes state which is passed down through props but since component is keeping its own state, it now needs to getDerivedStateFromProps
Now state lifted up to a parent component, all setters are "prop drilled" down.
To prevent prop drilling entire components are passed down through the hierarchy with their own state to be rendered in a leaf node
Why I decided to refactor @knovigator #react UI to use a single-state manager