React-redux-form: What's the difference from redux-form

Created on 26 Apr 2016  路  5Comments  路  Source: davidkpiano/react-redux-form

Hey, I've been using redux-form package for a long time (v4), now there is v6 in alpha with the new api, similar to this package. I've seen you there in some issue discussions, so probably you are familiar with the changes.

I need to decide, what to pick for future use (all components will be custom, sync + async socket validation (via redux actions)). Can you please tell, what's the difference between redux-form v6 vs react-redux-form (can't find it in the new docs) ?

Thank you!

question

Most helpful comment

I'm working on writing the documentation for the differences between redux-form v6 and react-redux-form v1 (when it comes out). In short, the biggest difference between the two is:

  • Redux-Form acts like a framework
  • React-Redux-Form is a library

What this means is that you can use as much of or as little of RRF as you want, and it provides you the full flexibility to:

  • use your own reducers
  • use any custom components
  • validate, change, etc. at any time, from anywhere dispatch() is available

For sync and async validation, RRF provides many helper action creators for validating one field or many fields at a time. On the other hand, Redux-Form handles validation internally, through the decorator, so everything is validated whenever there is a change, regardless of if fields being validated have even changed. http://redux-form.com/6.0.0-alpha.5/docs/api/ActionCreators.md/

Also, RRF eschews the notion of decorating components, in order to give the developer more flexibility and control over the model and the form state. RRF is performance-driven, too, and batches actions into one whenever it can.

Version 1.0 of RRF will introduce the <Control> component which will make custom controls much easier.

Are there any specific questions you have?

All 5 comments

I'm working on writing the documentation for the differences between redux-form v6 and react-redux-form v1 (when it comes out). In short, the biggest difference between the two is:

  • Redux-Form acts like a framework
  • React-Redux-Form is a library

What this means is that you can use as much of or as little of RRF as you want, and it provides you the full flexibility to:

  • use your own reducers
  • use any custom components
  • validate, change, etc. at any time, from anywhere dispatch() is available

For sync and async validation, RRF provides many helper action creators for validating one field or many fields at a time. On the other hand, Redux-Form handles validation internally, through the decorator, so everything is validated whenever there is a change, regardless of if fields being validated have even changed. http://redux-form.com/6.0.0-alpha.5/docs/api/ActionCreators.md/

Also, RRF eschews the notion of decorating components, in order to give the developer more flexibility and control over the model and the form state. RRF is performance-driven, too, and batches actions into one whenever it can.

Version 1.0 of RRF will introduce the <Control> component which will make custom controls much easier.

Are there any specific questions you have?

Thank you for the quick answer. I guess I need to try and see, how it goes. I looked at RRF before, but was a bit confused with adding many form elements in the store (2 elements per form) while RF had only one element for all forms.

Btw, the docs are great!

@davidkpiano so, my last question - how stable is RRF now (any api changes to expect before v1) and when the v1 will be released (roughly) ?

I looked at RRF before, but was a bit confused with adding many form elements in the store (2 elements per form) while RF had only one element for all forms.

This is for flexibility, though I'm thinking that this can be simplified; it just comes down to finding the right API for it while allowing it to be flexible.

how stable is RRF now (any api changes to expect before v1)

I've been using it in production apps for months now; the biggest changes since then have been enhancements and edge-case bug fixes; no breaking changes. Even right now, all I've been working on is the stray bugs and performance improvements, as well as adding new features.

There is only going to be one major breaking change for v1 (hence the version bump), but it will be for simplification. The form state shape will no longer have all fields nested in .fields with flattened paths, but instead will be more akin to Redux-Form:

// old
userForm.fields['phones[3].number'].valid

// new (tentative)
userForm.phones[3].number.$field.valid

Also, v1.0 will introduce a couple of big features:

  • The <Control> component (currently used internally)
  • Built-in HTML5 constraint validation integration

The second means you'll be able to do things like this:

<Field model="user.email">
  <input type="email" required />
</Field>

// or with the new <Control> component:
<Control.input model="user.email" type="email" required />

and validation will automatically be reflected in the field state with the required, pattern, minlength, etc. HTML5 attributes.

Thank you for the very detailed answer, I appreciate it!

So, no major changes that'll need huge refactoring. This is fine for me, I'll try the RRF in my current project.

I think we can close the issue as this info will be added to the docs later and other devs can find the answer here for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidkpiano picture davidkpiano  路  4Comments

mrsufgi picture mrsufgi  路  3Comments

stevenmason picture stevenmason  路  4Comments

iBasit picture iBasit  路  4Comments

Jokinen picture Jokinen  路  3Comments