2 ms·
Amen. React 18 was the moment where they forgot they started as the V in MVC. Concurrent React was a mistake, and the hooks they had to add to make it work too
by unconed 4y ago
Amen. React 18 was the moment where they forgot they started as the V in MVC.
Concurrent React was a mistake, and the hooks they had to add to make it work too.
The main example I always cite of where the React team is naive is mousemove handlers:
- there is no guarantee that react will re-render between two mousemove events
- even if it did, creating a new mousemove handler after every move is ridiculous
- avoiding this using the `setState(s => s)` form doesn't work if you have multiple pieces of state or need to invoke other callbacks
Therefore, every mouse dragging UI I've built has used useRef instead, mutating state directly.
The answer from the react team to this seems to be.... nothing. They just say it's bad to mutate state and that it will lead to bugs, seemingly not realizing that so will useEffect for the reasons above.
I think OP is wrong, and that people who have never built an app with undo/redo don't know what they're talking about when it comes to front end dev... but the React team is definitely chasing the wrong ideas.
Also, forms utterly suck as a UI, and every form abstraction I've ever used was terrible and ran into a wall. It just seems pointless to try to optimize for it.
If some people want to make forms easier because it's most of what they do day to day... hint, they're atrocious front end developers.
- sibeliuss 4y ago> Amen. React 18 was the moment where they forgot they started as the V in MVC. Yep, exactly.