score:108

Accepted answer

Check the docs

You can control when Formik runs validation by changing the values of <Formik validateOnChange> and/or <Formik validateOnBlur> props depending on your needs. By default, Formik will run validation methods as follows:

Pass to your Formik the props validateOnChange={false} and validateOnBlur={false}

score:16

If you use useFormik hook, the next config should be added

  const formik = useFormik({
    initialValues,
    validationSchema,
    validateOnChange: false, // this one
    validateOnBlur: false, // and this one
    onSubmit: (values) => {
     do something on submit
    },
  });

score:32

Yeah. You can do something like this.

<Formik
        initialValues={initialValues}
        validationSchema={validationSchema}
        validateOnChange={false}
        validateOnBlur={false}
        onSubmit={(values, { validate }) => {
            validate(values);
        }}
    >

Related Query

More Query from same tag