redux-form README

The project's README from github.com/redux-form/redux-form. As one markdown file: README.md.

redux-form


You build great forms, but do you know HOW users use your forms? Find out with Form Nerd! Professional analytics from the creator of Redux Form.


NPM Version NPM Downloads Build Status codecov.io Code Climate styled with prettier Twitter URL Patreon Backers on Open Collective Sponsors on Open Collective

redux-form works with React Redux to enable an html form in React to use Redux to store all of its state.


💰Psst!! Do you know React and Redux? Sign up with Triplebyte to get offers from top tech companies! 💰


⚠️ ATTENTION ⚠️

If you're just getting started with your application and are looking for a form solution, the general consensus of the community is that you should not put your form state in Redux. The author of Redux Form took all of the lessons he learned about form use cases from maintaining Redux Form and built 🏁 React Final Form, which he recommends you use if you are just starting your project. It's also pretty easy to migrate to from Redux Form, because the <Field> component APIs are so similar. Here is a blog post where he explains his reasoning, or there are two talks if you prefer video. Formik is also a nice solution.

The only good reason, in the author's view, to use Redux Form in your application is if you need really tight coupling of your form data with Redux, specifically if you need to subscribe to it and modify it from parts of your application far from your form component, e.g. on another route. If you don't have that requirement, use 🏁 React Final Form.

Installation

npm install --save redux-form

Documentation

🏖 Code Sandboxes 🏖

You can play around with redux-form in these sandbox versions of the Examples.

Videos

A Practical Guide to Redux Form – React Alicante 2017
A Practical Guide to Redux Form – React Alicante 2017
Abstracting Form State with Redux Form – JS Channel 2016
Abstracting Form State with Redux Form – JS Channel 2016

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

redux-form (redux-form/redux-form)

Searching Database…

What is this?Redux Form is a higher-order component for React that uses react-redux to keep all of your form state in a Redux store instead of in local component state.
So it's a library I wire into my own React app, not a standalone tool?Right — it's a JavaScript library published on npm: you import it and wrap your own form components with it; nothing standalone gets installed or run.
How do I add it to a project?Run npm install --save redux-form, then follow the Getting Started guide; the README also links full API docs, examples and a FAQ.
Does my app need anything in place before it works?Your project must already use React with Redux connected via react-redux — Redux Form plugs into that store; the package targets Node 8.10 or newer.
Is it still the recommended way to build forms in React?No — the README itself warns that the community consensus is not to put form state in Redux. The author recommends React Final Form instead, and migrating is easy because the component APIs are so similar.
When does Redux Form still make sense then?Only when you need really tight coupling of your form data with Redux — for example subscribing to and modifying form values from parts of the app far from the form, like another route.
Can I try it without setting up a project?Yes — the README links code sandboxes where each example runs live, from a simple form up to a full multi-step wizard.
What do the sandbox examples cover?Synchronous, field-level, submit and asynchronous blur validation, initializing from state, field arrays, remote submit, normalizing, Immutable JS, selecting form values and a wizard form.
Why did the author stop recommending Redux Form for new projects?Maintaining it taught him where form state really belongs; he distilled those lessons into React Final Form and explains his reasoning in a blog post and two conference talks.
Is Redux Form abandoned?Not quite — the repo isn't archived and has collected over 12,000 GitHub stars since 2015, but the README steers new projects to React Final Form, with Formik mentioned as another nice option.
Creator
redux-form
Size
9.8 MB
Stars
12.5K
Age
11y
Commits · 90 Days