React Redux is the official set of React bindings for the Redux state management library. It provides utilities and hooks like `Provider`, `useSelector`, `useDispatch`, and `connect` to integrate Redux stores with React components efficiently. The current stable version is 9.2.0, which includes compatibility for React 19. The package typically follows a release cadence that aligns with major React and Redux core updates, with bugfix and minor feature releases occurring regularly. Key differentiators include its official status, deep integration with the Redux ecosystem, and optimizations for performance in large-scale React applications, such as automatic batching of updates with React 18+.
npm install react-reduxVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a basic Redux store with `createStore`, providing it to a React application via `Provider`, and consuming the state and dispatching actions in a functional component using the `useSelector` and `useDispatch` hooks. It includes basic TypeScript types for the state.
Upgrade your React installation to v18 or later and Redux to v5.0.0 or later (or Redux Toolkit to v2.0.0 or later).
Ensure your bundler (Webpack, Rollup, Vite) is configured to handle modern module resolutions. Avoid direct imports from internal paths, preferring top-level named exports.
For applications using React 18+, rely on React's automatic batching. Only use `batch` for specific scenarios where explicit batching of non-React updates is required. Do not import `unstable_batchedUpdates` directly from `react-dom` or `react-native`.
Ensure your `react-native` version is compatible with React 18. If encountering import/bundling issues in React Native projects, verify you are on `react-redux` v9.0.2 or later for specific RN bundle tweaks.
Create typed versions of your hooks: `export const useAppDispatch = useDispatch.withTypes<AppDispatch>();` and `export const useAppSelector = useSelector.withTypes<RootState>();`.
Add `'use client';` at the top of the file where your `Provider` and client-side logic resides. React Redux v9.0.0 explicitly throws on use in RSCs to indicate incompatibility.
Ensure your `Provider` component receives a `store` prop: `<Provider store={myReduxStore}>...</Provider>`. In tests, wrap components with a test `Provider` or mock `useSelector`/`useDispatch`.Verify that your `createStore` or `configureStore` call successfully returns a valid store object and that this object is correctly passed to the `Provider`'s `store` prop. Check for typos or asynchronous initialization issues.