user2881227
user2881227

Reputation: 21

What is the equivalent of the onSubmitFail from 'redux-form'

https://final-form.org/docs/

onSubmitFail does not seem to exist in react-final-form, is there an equivalent or a work around?

In redux-form you could pass an onSubmitFail fail prop

AfterCheckoutForm = reduxForm({
  form: formName,
  destroyOnUnmount: false,

  onSubmitFail: errors => {
    scrollToErrors();
  }
})(AfterCheckoutForm);

Upvotes: 1

Views: 564

Answers (1)

Erik R.
Erik R.

Reputation: 7272

No, but there is a solution specifically tailored to scroll to errors. 😄

Check out final-form-focus.

Upvotes: 1

Related Questions