Our previous alpha versions included both
useSelector() (similar to
useActions() (similar to
However, Dan Abramov strongly suggested that we consider removing
useActions(), as the idea of "binding action creators" is less relevant when using hooks, and also adds conceptual overhead and syntactic complexity. We requested feedback from alpha users, and the initial feedback agreed with Dan's suggestion.
Based on that feedback, v7.1.0-alpha.4 removes the
useActions() hook. Instead, call
useDispatch() in your component, and manually call
dispatch(someActionCreator()) in callbacks and effects as needed.
If you still wish to use
useActions(), the hooks alpha docs page has an implementation you can copy and paste into your own code.
- Remove useActions ( 54fd9dd )