You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constschema=Yup.object().shape({email: Yup.string().required().email().matches(/@.+\..+/,'email must be a valid email').test('email-exists','email already exists',(value)=>{// api which checks if email exits in databaseconsole.log('api triggered')returnfalse// assume email exists})})awaitschema.validate({email: 'a'},{abortEarly: false})
here we get three error messages, at test() api gets hit unnecessarily. what I want if email() rule is failed, yup should stop validating next rules. I wish if we could have abortEarly: true on field itself, not on validate function.
The text was updated successfully, but these errors were encountered:
here we get three error messages, at test() api gets hit unnecessarily. what I want if email() rule is failed, yup should stop validating next rules. I wish if we could have abortEarly: true on field itself, not on validate function.
The text was updated successfully, but these errors were encountered: