Skip to content
Discussion options

You must be logged in to vote

RHF doesn't support throwing errors in the submit handler with the current API design.

We used to "swallow" the error, which is wrong.

When you throw inside the submit handler, some part of RHF state handling code is not run, hence your use-case.

Please, handle rejected promises in your code instead.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Mudbill
Comment options

@npearson72
Comment options

@Mudbill
Comment options

@echo-999
Comment options

Answer selected by Mudbill
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants