Replies: 2 comments 2 replies
-
could you try to follow this example: https://codesandbox.io/s/react-hook-form-customresoliver-v7-8mpqw ? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I get the same issue. It's a custom resolver, I console.log at the end of the resolver and it cleans the data but formState keeps the same error |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Version Number
7.33.1
Codesandbox/Expo snack
https://codesandbox.io/s/custom-hook-with-resolver-v7-forked-3rvv0i
Steps to reproduce
Expected behaviour
I'm trying to get custom yup resolver to work, but I have problems with getting correct values from formState: {errors}
Mode is set to 'all' so errors should be updated dynamically. Now formState: { error } state is updated according to resolver output only on submit.
I tried to use trigger function without any luck as well.
I based the example on this docs https://react-hook-form.com/advanced-usage#CustomHookwithResolver,
https://codesandbox.io/s/custom-hook-with-resolver-v7-cwczk, but I had to change the code a bit, because it didn't seem to work properly - no errors were reported to console, there is errors include instead of formState: {errors}.
Am I doing something wrong?
This resolver without Yup integration seems to work properly https://codesandbox.io/s/react-hook-form-resolver-rvspp
Many thanks for any input!
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions