To submit a form in Formik, you need to somehow fire off the provided
submitForm prop. When you call either of these methods, Formik will execute the following (pseudo code) each time:
initialValuesare required and should always be specified. See #445
validationSchemaasynchronously and deeply merge results
false, proceed to "Submission"
setSubmitting(false)to finish the cycle
It is common practice to only show an input's errors in the UI if it has been visited (a.k.a "touched"). Before submitting a form, Formik touches all fields so that all errors that may have been hidden will now be visible.
Disable whatever is triggering submission if
If the submission handler does not return a promise, make sure
setSubmitting(false) is called at the end of the handler.