News for hackers. Stuff that matters.
Re:When Does a Project Need React? by z3t4 on Monday April 24, 2017 @03:11PM (#14187125)
you should not store the state in the view layer. the easiest aproach is to store the state in the backend database layer.
Re:When Does a Project Need React? by mambodog on Monday April 24, 2017 @05:12PM (#14188339)
What about 'view state' such as which tokens have been typed into a typeahead/tagging style input? Or the expansion state of levels of a tree view? The active tab of a tabbed UI?
Re:When Does a Project Need React? by z3t4 on Friday May 05, 2017 @04:54PM (#14276769)
If nothing depends on the tagging, tree view or witch tab is active, then it's fine. Or if the state is discarded once the user click the "post" button it's also fine. But as features gets added things tend to "entangle" and things get more complicated. You'll end up with weird bugs like when the user has the app open in two tabs, or on two or more devices, where for example a message is marked as "read" on one devices but not the other. Or if two models interacts with the same view and races to change the state or just overwrites it.