Returning the error type for useForm (react-hook-form) #209
MrOxMasTer
started this conversation in
Ideas
Replies: 1 comment
-
It's better to give the option to use resolver, because converting it just won't work because of the |
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
-
The problem also occurs when used with react-hook-form. I need the server action to issue a special type error for userForm.
There are 3 solutions to the problem:
flattenReactHookForm
, allowing the user to recycle into the error type needed for theuseForm
hookYou can make root error as serverError and validationErrors as field errors
In method 3, the problem is that
root
is both the error type and the text, whileserverError
is just text (different types).So it is probably better to give the option to put resolver in
schema
.Beta Was this translation helpful? Give feedback.
All reactions