npm final-form 3.0.0
v3.0.0

latest releases: 4.20.10, 4.20.9, 4.20.8...
6 years ago

⚠️ BREAKING CHANGE ⚠️

onSubmit is now passed the form api as well as the values. #47 final-form/react-final-form#69

In v2.x.x:

createForm({
  onSubmit: (values) => {
    const promise = sendToServer(values)
    return promise
  }
})

OR

createForm({
  onSubmit: (values, callback) => {
    sendToServer(values, callback)
  }
})

In v3.x.x:

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

OR

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

Don't miss a new final-form release

NewReleases is sending notifications on new releases.