4 ms·
It will be interesting to see whether the React Forget compiler (https://reactjs.org/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.html#reac
by fabian2k 4y ago
It will be interesting to see whether the React Forget compiler (https://reactjs.org/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.html#react-compiler https://reactjs.org/blog/2022/06/15/react-labs-what-we-have-...) will change any of this. I'm curious how this will turn out to work, and if it will remove some of the issues that tend to confuse and annoy people.
My own impression is that the core model of state and rerendering is actually quite nice and intuitive, though often explained a bit wrong. The part that makes it complex and confusing are things like callbacks, which can trigger lots of unnecessary rerendering and force quite some boilerplate if you want to avoid that. If you can remove all the stuff around trying to avoid rerendering unnecessarily, React would be a lot simpler.
I also think that people are too quick to use the wrong tools for managing state in React, e.g. Context to avoid a bit of prop drilling.