How to make zod refine + react-hook-form errors update onChange #11507
Unanswered
truong120201
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
thank for your help.
I'm using react-hook-form and zod to validate fields
For example I have 2 fields
which I want if field title has value is 28 then field body is required
in this case I can validate the fields, but I got problem when I follow these steps
fill 28 to title
hit submit
=> errors show at body (required) // <- correct till this step

but when I change title to 29, the errors from body still appear (errors from formState still has value for body), it only disappear after I hit submit (I want it disappear when I change title value)

Beta Was this translation helpful? Give feedback.
All reactions