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.
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 useuseDispatch/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.
Yea. The hooks have to be in the component. This is inherent to using hooks instead of connect.