DEV Community

Discussion on: What's hard about React Hooks for you?

Collapse
 
samsch_org profile image
Samuel Scheiderich

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.

Collapse
 
kentcdodds profile image
Kent C. Dodds

This is very true

Collapse
 
samsch_org profile image
Samuel Scheiderich

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-...

Collapse
 
bendman profile image
Ben Duncan

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.