3
11 Comments

React JS Devs: What Form Library to use?

For those using react, do you recommend a particular library for handling forms?

I'm looking at one of these:

https://github.com/final-form/react-final-form
or
https://react-form.js.org/#/
or
https://joepuzzo.github.io/informed

Any experience with any of these good or bad? Or another one I'm missing?

  1. 4

    You'll definitely want to add Formik to the list for consideration: https://github.com/jaredpalmer/formik

    1. 1

      thanks, will add to my list to review. I had not seen that one before.

  2. 2

    Used Final Form in the quite complex projects. Well thought through library

    1. 1

      cool. that seems to be the one im leaning towards.

  3. 2

    I don't work with React so I am curious - why do you need a form library? For instance in Vue.js or Angular it is pretty easy to create a form. What is missing in React so that you need another library for it?

    1. 3

      Isn't a "need". But a library can simplify validation and form submission.

  4. 2

    redux-form is awesome for that!

    I never heard/used any of your listed alternatives though.

    1. 1

      thx - I'll add that to my reviews. It seems people often moved from redux-forms to react-final-form (not sure yet exactly why).

      1. 2

        Redux form is extremely heavy IMO, both in library size (30kb minified and gripped https://bundlephobia.com/result?p=redux-form@8.0.4), in boilerplate (supplying initial values requires a whole selector dance) and possibly in performance (an action is dispatched on every. form. interaction.) A lot of people have also come to the conclusion that Redux isn't the appropriate place to store form data.

        I'll throw my hat in with React Final Form — my company switched from Redux form to that and it's been much easier to manage (one reason that a lot of people make that particular switch might be that they're by the same author). I'm not familiar with the other two libraries you listed, but we chose it over Formik which is another very popular form library.

        1. 1

          curious if you can share any pros/cons in why you chose final form over Formik

        2. 1

          ah, maybe that is what i remember reading. Seems like the author is more focused on Final Form than Redux Form, no? I'm likely leaning towards Final Form over Redux Form as well. Thanks for your insight.

  5. 1

    This comment was deleted 8 years ago