Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

React Redux Form v1.2.5

Compare
Choose a tag to compare
@davidkpiano davidkpiano released this 01 Dec 17:06
· 548 commits to master since this release

Fixes and Enhancements

  • πŸ†• Deep validators for models in <Form>! You can now do this:
const required = (val) => !!val;

<Form model="user"
  validators={{
    'phones[].number': { required }
  }}
>

and it will validate individual phone numbers whenever that model has changed. See #510 (related PR: #541) for more information.

  • Now, dispatching actions.setInitial(...) will no longer affect the model value - its only purpose is to reset the field value to its initial state and has no effect on the model value. #546
  • The states of the parent forms will be updated as touched or retouched when one of their fields are touched or retouched. #549
  • πŸ†• You can now remotely submit a form! Here's how:
// let's say you have a form:
<Form model="user" onSubmit={...}>
  // ... etc.
</Form>

// as long as the form above is currently mounted,
// you can trigger a submit for it anywhere:
dispatch(actions.submit('user'));

That is, if actions.submit('user') is only given the model, it will just trigger validation on the existing <Form>, which can call onSubmit and/or onSubmitFailed, depending on the submission status of the form.

The documentation has been updated to reflect this change.

  • πŸ†• There is now an onSubmitFailed={...} prop on <Form> (and <LocalForm>, transitively) that handles when a form submission has either failed after an async submit, or if a form submit was attempted with an invalid form state.

Coming Soon
Support for Preact and possibly Inferno!