I have a Formik form that gets cleared automatically after all fields are validated and the form is submitted. The purpose of this form is to basically register a new user, so it is a pretty lengthy form.
The problem is that sometimes the email a user enters has been used, or some other value gets bounced back from the backend. For a user it is quite annoying if you're asked to fill a form from the beginning just because one value is incorrect.
How can I prevent Formik from clearing this form automatically, or at least wait for the response from the backend, and then clear or retain the values of the form depending on which one was wrong.
My form is structured this way;
<Formik
initialValues,
onSubmit
validationSchema,
>
{()=> return (
<Form>
<Field />
//...quite a long form
What can I do in this situation?