Getting Started with React Redux#

React Redux is the official React UI bindings layer for Redux. It lets your React components read data from a Redux store, and dispatch actions to the store to update state.


React Redux 7.1+ requires React 16.8.3 or later, in order to make use of React Hooks.

Using Create React App#

The recommended way to start new apps with React Redux is by using the official Redux+JS template for Create React App, which takes advantage of Redux Toolkit.

npx create-react-app my-app --template redux

An Existing React App#

To use React Redux with your React app, install it as a dependency:

# If you use npm:
npm install react-redux
# Or if you use Yarn:
yarn add react-redux

You'll also need to install Redux and set up a Redux store in your app.

If you are using TypeScript, the React Redux types are maintained separately in DefinitelyTyped. You'll need to install those as well:

npm install @types/react-redux

The code used for this example is based on the official Redux template. Additionally, the same code template for TypeScript can be found here.


React Redux includes a <Provider /> component, which makes the Redux store available to the rest of your app:

import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import App from './App'
const rootElement = document.getElementById('root')
<Provider store={store}>
<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.

import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import {
} from './counterSlice'
import styles from './Counter.module.css'
export function Counter() {
const count = useSelector(selectCount)
const dispatch = useDispatch()
return (
<div className={styles.row}>
aria-label="Increment value"
onClick={() => dispatch(increment())}
<span className={styles.value}>{count}</span>
aria-label="Decrement value"
onClick={() => dispatch(decrement())}
{/* omit additional rendering output here */}

Help and Discussion#

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!

You can also ask questions on Stack Overflow using the #redux tag.

Docs Translations#