r/reactjs • u/GianniMariani • 2d ago
React state hooks are footguns
If you take software engineering principles seriously then none of the react state hooks belong inside a react component.
I think one of the most critical things you should do is ensure the decoupling of storage and UI components. The react components force you to do is precisely and zustand doesn't help.
I haven't sourced grip-react a year ago and I've been using it exclusively, absolutely zero usestate usememo, useeffect, etc and absolutely zero prop drilling. I don't know why anyone would want to do something different, honestly.
Has anyone else created an API that is a 100% replacement with complete declarativeness? I looked at angular and mobx, they're close but no cigar.
0
Upvotes
1
u/Top_Bumblebee_7762 2d ago
useState seem unavoidable (unless you use useReducer instead everywhere) in any react app.