Re:React best practices
by dragonwriter on Wednesday May 05, 2021 @05:40PM
(#27056158)
> OP for example is making extensive use of Hooks, which are well-known not to be the best solution to the problem of state management within React.
Hooks are fine. Using React’s built in Hooks [0] for nonlocal state management is a bad idea, but using, say, react-redux and useSelector/useDispatch is a different story.
Well, if you use useState for something other than local component state, but that’s pretty expressly not using it correctly.
[0] which are fine for local, intracomponent, state management, including within groups of components that are tightly logically coupled so that implementation coupling isn’t really adding an additional burden.
Hooks are fine. Using React’s built in Hooks [0] for nonlocal state management is a bad idea, but using, say, react-redux and useSelector/useDispatch is a different story.
Well, if you use useState for something other than local component state, but that’s pretty expressly not using it correctly.
[0] which are fine for local, intracomponent, state management, including within groups of components that are tightly logically coupled so that implementation coupling isn’t really adding an additional burden.