⚠️ 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)
}
})