Guide · Open source
How to use redux-form: install and keep form state in Redux
Updated · written with AI from the project's own documentation and checked against our catalogue data
redux-form is a React library, built as a higher-order component on top of React Redux, that stores the state of an HTML form in a Redux store. This guide explains what it does, how to install it with npm, and when the README suggests a different tool. By the end you will know whether your project fits it and where to start.
Quick start
- 1Check your prerequisites. Make sure you have Node.js and npm, and that your project already uses React, Redux and React Redux.
- 2Decide if redux-form fits. Confirm that you need form values in Redux, for example to read them from another route. If not, the README suggests React Final Form or Formik.
- 3Install the package. Run npm install --save redux-form in your project folder.
- 4Read the Getting Started guide. Open the Getting Started guide linked from the README to set up your first form.
- 5Try an example. Open a sandbox example, such as Simple Form, to see how a working form is built.
- 6Check the API reference. Use the API reference to look up the functions and components you need as you build.
What does redux-form do?
redux-form works with React Redux to let an HTML form in React use Redux to store all of its state. Form values live in the Redux store rather than only inside individual components.
The main reason to do this is access from elsewhere in your app. Other parts of the UI, such as a component on another route, can read or change the form values.
Should you use redux-form for a new project?
The README says that the general consensus of the community is that you should not put your form state in Redux if you are just starting out. It recommends React Final Form for new projects, and notes that Formik is also a nice solution.
According to the author's view in the README, the only good reason to use Redux Form is a need for really tight coupling of form data with Redux, such as subscribing to and modifying it from parts of the application far from the form component.
- Starting a new project with no need for form state in Redux: consider React Final Form or Formik.
- Need form values read or changed from distant parts of the app: redux-form may fit.
- Maintaining an existing project that already uses redux-form: keep using it.
Install redux-form with npm
The README lists Node.js and npm, React, Redux and React Redux as the things you need. Install the package with npm using the command below. The README's install section gives this exact command.
Because the library is built on React Redux, your app should already have Redux and React Redux set up.
npm install --save redux-formLearn the core API and examples
The project documentation includes a Getting Started guide, an API reference and an FAQ. The README also links to a set of examples, each with a sandbox you can open in the browser.
The examples cover topics such as synchronous validation, field-level validation, submit validation, field arrays, normalizing, Immutable JS, and a wizard form.
- Getting Started guide for the first setup
- API reference for the full list of functions and components
- Examples such as Simple Form, Field Arrays and Wizard Form, available as code sandboxes
Know the alternatives before you commit
The README names React Final Form, Formik and React Hook Form as comparable projects. It describes React Final Form as easy to migrate to from Redux Form, because the Field component APIs are similar.
Choose based on your app. If your form state does not need to live in Redux, the README points you toward the other options.
- React Final Form: recommended by the README for new projects
- Formik: described in the README as a nice solution
- React Hook Form: listed as a comparable project
What people use it for
- A checkout form whose values are also shown in a summary on a different route
- A multi-step wizard form, which the README includes as an example
- A form with field arrays, such as a list of repeated inputs
- A form with synchronous or asynchronous validation, as shown in the examples
Frequently asked questions
Is redux-form free to use?
redux-form is released under the MIT licence, according to the project summary. Check the licence file in the repository for the full terms before using it in your project.
What do I need before installing redux-form?
The README lists Node.js and npm, React, Redux and React Redux as prerequisites. The library is built specifically on React and React Redux, so it is not meant for non-React projects.
How do I install redux-form?
Run npm install --save redux-form in your project. The README gives this as the installation command.
Is redux-form good for beginners?
The library assumes you already know React and Redux. Beginners are better served by learning those first or by choosing a simpler form library.
Should I use redux-form or React Final Form?
The README recommends React Final Form for most new projects. It suggests redux-form only if you specifically need tight coupling between form data and Redux.
Is redux-form the same as Formik?
No. redux-form stores form state in Redux, while the README describes Formik as a separate solution that the author also considers a nice option. Pick based on whether you need Redux-managed form state.
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
redux-form suits React developers who already use Redux and need form values readable and changeable from elsewhere in the app, or teams maintaining an existing redux-form project. If you are starting fresh without that need, the README recommends React Final Form or Formik instead.
Install options & downloads