DEV Community

Discussion on: How To Use Redux With React

Collapse
 
dance2die profile image
Sung M. Kim • Edited

Redux hooks have ups and downs compared to connect.

connect lets you decouple your component (making it resuable) but a lot of times that abstraction might not be needed. Then you'd use useDispatch/useSelector. But hooks are really darn easy though, and more readable even though it's usable only within function components.

So the bottomline is knowing both ways would help understand trade-offs and when to use each one.

Collapse
 
aumayeung profile image
John Au-Yeung

Yea. The hooks have to be in the component. This is inherent to using hooks instead of connect.