Skip to content
Discussion options

You must be logged in to vote

Thanks for the feedback above. It's a valid one. Let me explain the reason behind a such design.

Why

RHF focus on a single input at a time to provide the best performance to your form, in your use case above is a dependency validation. This explains why the input didn't render the correct errors object as your validation focus is at Input A, while you want to show an error message for Input B.

I have considered this problem for a while now, there isn't a perfect solution on the table. If we display all the errors message, then we would lose fine control on when and what to re-render. for example, when the whole form is mounted, the entire form is full of errors (if there are no defaultValues

Replies: 1 comment 10 replies

Comment options

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

@bluebill1049
Comment options

@rosemariesadler
Comment options

@bluebill1049
Comment options

@sanmont3drepo
Comment options

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