Skip to content

v2.0.0

Compare
Choose a tag to compare
@erikras erikras released this 18 Dec 18:07
· 426 commits to master since this release

Bug Fixes

  • Fixed devDependencies to be compatible with prop-types package. #67

New Features

  • Upgraded to be compatible with [email protected], which allows:
    • New isEqual prop can be given to Field to be used in calculating pristine/dirty. Defaults to ===.
    • New validateFields prop can be given to Field to specifically name other fields to run field-level validation on when that field changes. You can also pass [] to run field-level validation only on the field that has changed. See validateFields docs.

⚠️ BREAKING CHANGES ⚠️

  • Upgraded to be compatible with [email protected] #69, which provides access to the form api in onSubmit:

In v1.x.x:

<Form onSubmit={values => {
  const promise = sendToServer(values)
  return promise
}}/>

OR

<Form onSubmit={(values, callback) => {
  sendToServer(values, callback)
}}/>

In v2.x.x:

<Form onSubmit={(values, form) => {
//                     ^^^^^^ -------------------- 🆕
  const promise = sendToServer(values)
  return promise
}}/>

OR

<Form onSubmit={(values, form, callback) => {
//                     ^^^^^^ -------------------- 🆕
  sendToServer(values, callback)
}}/>