loading...

re: What's hard about React Hooks for you? VIEW POST

FULL DISCUSSION
 

One of the most common struggles I've seen people have is not being able to remove the idea of imperative life cycles from their mental flow, and switching to thinking in terms of declarative effects.

It's really strongly ingrained in a lot of users to think more about mounting, updating, and unmounting instead of just rendering, and what (effect) you want to happen when you render, given some state.

 

This is very true

 

It's been a common riff the last few days, so I've written a post on it: dev.to/samsch_org/effects-are-not-...

 

I find this is the most unnatural part of hooks: the lifecycle paradigm fit the mental model of React/DOM interaction a lot better than hooks, and many integrations with non-React libraries require instantiating on mount and destroying on unmount.

Code of Conduct Report abuse