DEV Community

Discussion on: Opinionated React - Use Status Enums Instead of Booleans

Collapse
 
clamstew profile image
Clay Stewart • Edited

I’ve done this a dozen times. I think you’re right to formalize it. Nice post.

But I tend to agree with some of the comments. One great thing about selectors in redux is the ability to easily derive state. And I think there is still a space for functions that derive react hooks state based on state like data and loading without having to store additional state. This is one reason I’ve been leaning on useReducer, because you can export selectors from the hook, too, since it has access to a whole sub-state object.

Collapse
 
farazamiruddin profile image
faraz ahmad

Thank you 🙏🏽