alanfljesus
alanfljesus

Reputation: 179

disable validation with click yup schema

How can I make it so that after clicking on the input the 'yup' doesn't add a validation?

Demonstration

const signInFormSchema = yup.object().shape({
  email: yup.string().required("Required email").email("Invalid email"),
  password: yup.string().required("Password required"),
});

Upvotes: 0

Views: 651

Answers (1)

Miguel Caro
Miguel Caro

Reputation: 298

if you are using Formik you just need to set validateOnBlur to false

https://formik.org/docs/api/withFormik#validateonblur-boolean

Upvotes: 2

Related Questions