React Redux 7.1+ requires React 16.8.3 or later, in order to make use of React Hooks.
To use React Redux with your React app, install it as a dependency:
If you are using TypeScript, the React Redux types are maintained separately in DefinitelyTyped. You'll need to install those as well:
React Redux includes a
<Provider /> component, which makes the Redux store available to the rest of your app:
React Redux provides a pair of custom React hooks that allow your React components to interact with the Redux store.
useSelector reads a value from the store state and subscribes to updates, while
useDispatch returns the store's
dispatch method to let you dispatch actions.
The #redux channel of the Reactiflux Discord community is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - come join us!