DEV Community

Discussion on: Why i won't use React Hooks

Collapse
 
jaffparker profile image
Jaff Parker

I can understand your concerns. Though at the same time, hooks are just an upgrade for the lifecycle functions of class components or the HOC's, but they make it simpler, so if you used those, there's no reason you shouldn't use hooks. I find that hooks look clearer than HOC's or lifecycle functions (HOC's would just always confuse me when I have to compose them, especially when I'd try to create props typings).

I get though that you want to keep your components as much functional as possible. Personally, I started separating my components into containers and views. Views have nothing async, zero side effects, just props => ReactElement. All the data loading and state management and side effects happen in containers. Even when I switch to hooks, it will stay that way.