Reputation: 3329
It is easy to set a form error in onSubmit
with
throw new SubmissionError({ _error: 'My form error message.' });
But how do I remove this error? It is not removed when re-submitting and it is not removed when changing fields values.
Can I manually remove the message somehow, e.g. from onSubmit
when re-submitting the form or after a timeout?
Upvotes: 0
Views: 1625
Reputation: 7272
It's not super elegant, but you can do:
import { stopSubmit } from 'redux-form'
...
// remove all submit errors
dispatch(stopSubmit('formName', {}))
Upvotes: 1