0

I have an email field and I am validating its uniqueness as the user types in i.e is the email the user is typing available. Currently, I only get the error message when the user loses focus of the field (onBlur) but I want formik to show errors while the user is typing in. I've read that showing errors on losing focus on the field is the 'default' behavior of formik but I was hoping maybe there was a way to achieve what I want?

mikasa
  • 783
  • 1
  • 11
  • 29

1 Answers1

2

You can use Formik's validateOnChange prop to trigger validations on every change event

See here for details

thedude
  • 9,388
  • 1
  • 29
  • 30
  • 7
    I believe they're both set to true by default. Changing their values did not work for me. – mikasa Aug 20 '20 at 08:35