r/reactjs • • Oct 31 '18

Why the hate for React Hooks?

I've been seeing a lot of mixed feelings about React Hooks since it was announced and can't quite figure out why. Sure it's a deviation from the norm, but completely optional and certainly lowers the barrier to entry for new developers.

Can someone explain why all the negative feelings are rising about it?

19 Upvotes

74 comments sorted by

View all comments

Show parent comment

5

u/Veranova Nov 01 '18

One example being that useEffect takes a function which sets something up and returns a function to tear it back down. That kind of convention is unclear to read especially when useEffect is also usually created within a closure where the flow is equally unclear. The flow of logic is very unobvious to an inexperienced eye, and I think life cycle events solve that problem quite well in the context of components.

Note I'm talking about the creation of custom hooks, I think the way they're used is a perfectly sane approach to cross cutting concerns