4 ms·
> Why is state management such a talked-about issue with React? The "state problem" that exists in React, Vue, Flutter etc. is due to their maintaining compone
by aryehof 7y ago
> Why is state management such a talked-about issue with React?
The "state problem" that exists in React, Vue, Flutter etc. is due to their maintaining components in a hierarchical tree. It is a manifestation of a "cost" (drawback) in that tree-based approach.
React represents elements as encapsulated components that can be composed into more complex elements, which are maintained in a hierarchical tree.
That's the main attraction. One can reason about independent pieces representing some aspect of UI. Those pieces can be building blocks used to build more complex things.
The price for this is that how these (encapsulated) components communicate and share data between them is problematic because of that hierarchical tree structure, where an element only knows its parent and child(ren).