Search code examples
reactjsformikformik-material-ui

Warning: isInitialValid has been deprecated and will be removed in future versions of Formik


Warning: isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead.

I didn't find validateOnMount in formik ?

enter image description here

 const formik = useFormik({
    initialValues,
    isInitialValid:false,
    validationSchema ,
    onSubmit: (values, errors) => {
      console.log(JSON.stringify(values, null, 2));
       
    },
  });

I tried to use validateOnMount instead of isInitialValid:false but it has error.


Solution

  • Have you tried validateOnMount? I had the same issue and got it solved by just adding this.