Skip to content

Guide · Open source

How to use react-redux: install, connect a store and hooks

Updated · written with AI from the project's own documentation and checked against our catalogue data

React Redux is the official library that connects a Redux state store to React user interfaces. It lets your components read data from one central store and send changes back to it. This guide shows you how to install it, what it needs before you start, and where to go next for setup and usage details.

React Reduxreduxjs/react-redux · ★ 23.4k · MIT

Quick start

  1. 1Pick a starting point. Use the Vite or Next.js template for a new app, or add React Redux to an existing one.
  2. 2Confirm prerequisites. Make sure you have React 18 or later, Redux installed, and npm or Yarn available.
  3. 3Install the package. Run npm install react-redux or yarn add react-redux in your project folder.
  4. 4Set up a Redux store. Follow the Redux store setup recipe linked in the README so your app has a store to connect to.
  5. 5Read the docs. Use the official docs at react-redux.js.org for component connection patterns and API details.

Start a new app with React Redux already set up

If you are starting a new project, the README recommends using an official template instead of wiring everything by hand. It points to the official Redux+TS template for Vite, or to a new Next.js project created with Next's with-redux template.

Both templates already have Redux Toolkit and React-Redux configured for their build tool. They also include a small example app that shows several Redux Toolkit features.

# Vite with our Redux+TS template # (using the `tiged` tool to clone and extract the template) npx tiged reduxjs/redux-templates/packages/vite-template-redux my-app # Next.js using the `with-redux` template npx create-next-app --example with-redux my-app

Add React Redux to an existing React app

React Redux 9.0 requires React 18 or later. To use it in an existing app, install it as a dependency with npm or Yarn.

You also need Redux itself installed and a Redux store set up in your app. The README links to the Redux installation guide and the store setup recipe for both steps.

  • Check that your React version is 18 or later.
  • Install Redux in the project if you have not already.
  • Set up a Redux store, as described in the Redux docs.
# If you use npm: npm install react-redux # Or if you use Yarn: yarn add react-redux

Know the bundler assumption before you start

The install instructions assume you use npm with a module bundler such as Webpack or Browserify, consuming CommonJS modules.

The README offers a single-file UMD build that exposes a ReactRedux global, available from cdnjs. It does not recommend this for any serious application, because most libraries that complement Redux are only published on npm.

Find the documentation and background reading

The React Redux docs are published at https://react-redux.js.org. The README also links to two articles by the maintainers: one on the history and implementation of React-Redux, and a Deep Dive talk that covers similar material at a higher level.

These resources explain what the library does, how it works, and how its API has changed over time.

  • Docs: https://react-redux.js.org
  • Background article: The History and Implementation of React-Redux
  • Talk: Deep Dive into React-Redux

What people use it for

  • Sharing login state, user settings or a shopping cart across many React components
  • Letting several screens in one app read and update the same data without passing props through every level
  • Starting a new Vite or Next.js app with Redux and React Redux already configured

Frequently asked questions

Is react-redux free to use?

Yes. The project is licensed under the MIT License, as stated in the README. You can read the full license in the repository's LICENSE.md file.

What does react-redux require?

The README says React Redux 9.0 requires React 18 or later. You also need Redux installed and a Redux store set up in your app, and npm or Yarn to install the package.

How do I install react-redux?

Run npm install react-redux if you use npm, or yarn add react-redux if you use Yarn. The package is installed as a normal project dependency.

Can I use react-redux without npm?

A UMD build is available from cdnjs and exposes a ReactRedux global. The README says it is not recommended for any serious application, since most complementary Redux libraries are only on npm.

Does react-redux work with Next.js and Vite?

The README recommends official starter templates for both. A Vite Redux+TS template and Next's with-redux template come with Redux Toolkit and React-Redux already configured.

What are the alternatives to react-redux?

Projects often compared with it include Zustand, Jotai, Recoil and MobX. This page does not compare their features or performance, so check each project's documentation before choosing.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

React Redux suits React developers whose apps share state across many components, especially teams already using Redux who want the official React connection. It is a poor fit for small React apps with little shared state, where Redux adds more setup than it saves, or for projects that do not use React.

Install options & downloads