Re:Common Beginner Mistakes with React
by marcosdumay on Sunday March 12, 2023 @01:39PM
(#35123316)
Interestingly, the optimal place I see to keep state is inside the reactive system. You just have to ensure that every single non-pure action is notated as an event.
You can even have a lot of pure state interdependence. What React doesn't even try (because yes, it's a view library).
Anyway, one can certainly keep all views pure. It's a bit hard in Javascript where a lot of things are hidden, but it's perfectly doable. It's even the recommended way to use React. But that doesn't save React from being way larger, slower, and harder to use than it could otherwise be.
You can even have a lot of pure state interdependence. What React doesn't even try (because yes, it's a view library).
Anyway, one can certainly keep all views pure. It's a bit hard in Javascript where a lot of things are hidden, but it's perfectly doable. It's even the recommended way to use React. But that doesn't save React from being way larger, slower, and harder to use than it could otherwise be.