Closed minajevs closed 1 year ago
@bluebill1049 I am sorry, why is it completed? What kind of detail should I add? I think codesandbox example is the most minimal and reproducing.
Hi @minajevs,
You forgot to handle submission so the app is restarting when u click submit
and the state will be empty, alternatively I changed the mode to onChange
so u can see the errors without submit in this codesandbox
Describe the bug
When using zodResolver
formState
errors
are empty.To Reproduce
Tested versions (all latest):
@hookform/resolvers
: 3.0.0, 3.1.0react-hook-form
: 7.43.9zod
: 3.21.4Consider basic schema:
and zodResolver:
and form:
then
errors
object is always empty.Codesandbox link (Required) https://codesandbox.io/s/affectionate-feather-q20cwg?file=/src/App.tsx
Additional context
isValid
works as expected. When debuggin resolver like this:validation result actually includes errors, but formState errors are still empty