github redux-form/redux-form v6.0.0-alpha.7

latest releases: v8.3.10, v8.3.9, v8.3.8...
pre-release7 years ago
  • Field Arrays 🎉 🎉 👯
  • Array-specific validation errors via the _error key on the array in the errors object. #486 #762 #868
  • Flux Standard Action Compliance. All redux-form actions follow FSA. #799 #586 #63
  • RIP bindActionData(), you were a clever functional trick, but you added too much complexity.
  • Stopped using Object.values(), which was causing problems. #881 #907
  • Allowed rerender on non-redux-form prop changes. #866 #906
  • New Material UI Example, courtesy of @mihirsoni.
  • And possibly most importantly, the performance of the Field Arrays Example is excellent even when you add many, many form fields. #529

Breaking Change

Previous alpha versions allowed

<Field name="firstName" component={React.DOM.input}/>

After a discussion with @gaearon on #871, the new API is with just a string:

<Field name="firstName" component="input"/>

Learning Field Arrays

The FieldArray component is pretty self-explanatory if you understand how to use the Field component. Check out the Field Arrays Example and the FieldArray docs.

render() {
  return (
    <div>
      <FieldArray name="awards" component={awards =>
        <div>
          <ul>
            {awards.map((name, index) => <li key={index}>
              <label>Award #{index + 1}</label>
              <Field name={name} type="text" component="input"/>
              <button type="button" onClick={() => awards.remove(index)}>Remove Award</button>
            </li>}
          </ul>
          <button type="button" onClick={() => awards.push()}>Add Award</button>
        </div>
      }/>
    </div>
  )
}

Don't miss a new redux-form release

NewReleases is sending notifications on new releases.