React

redux-form? again for new apps? redux-form is dying…

Managing Form State in React is hard. ReduxForm brought a really easy way to manage the state of the Form inputs inside redux store. Everything was fine. And it was the most popular Form Library for React apps.

But that was not perfect. The main bottleneck was the Performance!

Alt Text
  • As ReduxForm dispatches few actions for each keystroke, it actually takes time to execute all those.
  • ReduxForm saves the Form data to redux store. And as we know, after saving the data to store, Redux dispatches new state to all ConnectedComponents(aka Containers), all the connected components re-renders them which actually makes almost all the components re-render and makes the app slower.

*** Some of you might say now, we could use Memoization to fix that problem. Yes, you are right! But let’s be honest, most of us don’t have the time to develop a proper Memoized data flow through all the Components.

There are a huge number of react apps in the world where redux-form is still used.
But the creator of ReduxForm, Eric is slowly killing the Library. There is not enough development(nearly none).
We can see the graph below –

But the creator of ReduxForm, Eric is slowly killing the Library. There is not enough development(nearly none).
We can see the graph below –

Alt Text

Eric has been developing a new React form Library named react-final-form and they are actively developing it.

Alt Text

And even, He is proposing Migration guideline for migrating from redux-form to react-final-form

https://twitter.com/erikras/status/1146380371354947585

Also, there is one 👉 official migration doc

If you have redux-form already in your projects, then it’s probably better to use react-final-form as the migration is easier and both are developed by the same person(team) so they kept in mind that existing apps would migrate to the new one.

react-final-form is also lot smaller in size which is cool!

Alt Text

There is another awesome Library for Forms, is called Formik. You can have a look and decide what suits better for you.

I will share the npm download trends of all 3 Libraries for you to decide.

Alt Text

I will write separate articles for react-final-form and formik.

Till then,
Cheers! 👋

Buy Me A Coffee

As I am trying to contribute contents on the Web, you can buy me a coffee for my hours spent on all of these ❤️😊🌸

Standard

Leave a Reply

Your email address will not be published. Required fields are marked *