Skip to content
Discussion options

You must be logged in to vote

Commenting here out of curiosity. Aryan, from what I understand your form has some validation and then something happens and that validation is not needed anymore.

So you've got two alternatives:

  • Have a dynamic validation.
  • Clear the errors after that something happened and before submit.

I'm not a big fan of clearing the errors if you can avoid it, so I've made you an example of the second alternative: Conditional validation + useFormContext. Try using that form with the console open, so you'll see the order of events.

Would that alternative work for you?

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@aryaniyaps
Comment options

Comment options

You must be logged in to vote
2 replies
@bluebill1049
Comment options

@aryaniyaps
Comment options

Comment options

You must be logged in to vote
2 replies
@aryaniyaps
Comment options

@bluebill1049
Comment options

Answer selected by aryaniyaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants