Skip to content

v6.0.0-rc.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@erikras erikras released this 05 Jul 15:38
· 1398 commits to master since this release
  • Fixed bug involving validation and promise rejection. #1266

Breaking Change

Apologies for a major breaking change this close to release, but React just sprung this on us.

In React 15.2.0, you will get a warning in the console if you pass props to a DOM element that are not known by that element. For example, you cannot pass a pristine prop to an <input> component. If you are familiar with redux-form, you will understand that this is a problem for the "destructure all the props out into the <input>" paradigm that redux-form uses. As such, the props that the input needs, value, onChange, onBlur, etc., have been placed in a separate input structure in the props that Field gives to your component. The change is very small, but your code will break if you do not make it. Everywhere where you were destructuring {...field} into an input, you will need to destructure {...field.input} instead.

const renderField = field => (
  <div>
    <input {...field.input}/>
                 // ^^^^^^------------------ THAT is all you have to add. 👍
    {field.touched && field.error && <span>{field.error}</span>}
  </div>
)

You may read more about this on #1249 and the other issues and gists linked therein.

onUpdate prop removed

onUpdate was added in this library's infancy to make it work better "out of the box" with Belle. But since the input props got moved in this version, it no longer will work "out of the box" with any UI widget library, so it was removed for clarity. It was only ever an alias for onChange.