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

React Redux Form v0.9.4

Compare
Choose a tag to compare
@davidkpiano davidkpiano released this 30 Mar 18:20
· 1328 commits to master since this release

New Actions

  • actions.batch - mostly internal, this action allows multiple actions or action thunks to be batched into a single action that is understood by both the model and form reducer. This is a performance enhancement that can prevent multiple renders from occurring in the UI.
  • actions.validateFields - explicit action created for validating fields of a form. Takes in three arguments:
    • model - the model to validate
    • fieldValidators - an object where the keys are the field paths (such as "email" for user.email), and the values are validators (either functions or a validation object)
    • callback (optional) - a callback that is executed if the model is valid.
  • actions.move - model action that allows you to move an item in an array from index A to index B. Takes in three arguments:
    • model - the array to manipulate
    • fromIndex
    • toIndex
  • actions.load - similar to actions.change, but changes the model without triggering a "change" in the form reducer. Good for initializing values dynamically/asynchronously. Takes in two arguments:
    • model
    • value

Field Fixes and Improvements

  • Now, pressing the Enter key in a control inside of a <Field> will trigger a change before submitting the form. This is useful if you press Enter inside of an updateOn="blur" field.
  • The actual updated model values are now passed into <Field> validators instead of the event value.

Form Fixes and Improvements

  • Now, the actual form state will be used for checking if a <Form> is valid. This means that any validator can be used to update the validation state inside <Form>, which prevents onSubmit if the form is invalid. This includes:
    • validators inside <Field>
    • validators dispatched from actions