title: How to clear status before validation on Formik submit?
body: <p>I'm using Formik with yup validation, following this pattern:</p>
  <pre class="lang-js prettyprint-override"><code>const handleSubmit = async (values, { setStatus }) =&gt; {
    setStatus(''); // clean errors messages
    try {
      ... do submit work ...
        const res = await sendData( convertValues(values)); //
      ... more work
    } catch (e) {
      console.error(e);
      setStatus('an error occurred '...);
    }
  };
  
  const validationSchema = Yup.object({
    code: Yup.string().required(t('Required')),
    ....
  });
  
  return (
      &lt;Formik onSubmit={handleSubmit} initialValues={initialValues} validationSchema={validationSchema}&gt;
        {({ setFieldValue, status }) =&gt; (
          &lt;Form&gt;
            ....
            &lt;MyErrorComponent msg={status} /&gt;
          &lt;/Form&gt;
        )}
      &lt;/Formik&gt;
  );
  </code></pre>
  <p>This has problems in this scenario:</p>
  <ol>
  <li>User submits forms. Validation passes ok, but some error occurs inside <code>handleSubmit</code>. An error message is shown in status</li>
  <li>User edits form and retries</li>
  <li>This time a validation error occurs</li>
  <li>The validation error is displayed inside the input field...but the old status messsage is not cleared.</li>
  </ol>
  <p>This happens because validation occurs before submit, hence <code>setStatus('')</code> is not called.
  What's the recommended way to deal with this?</p>