Supplying additional rules via useController to a form that already has a resolver #5960
Unanswered
giovannipiller
asked this question in
Ideas
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.
-
I think it could be interesting to be able to:
useForm
, with the general validation rules for the form (already possible)useController
I find
useController
to be very useful when composing a form out of multiple components, due to its capability to keep validation rules close to the component that actually deals with that data.Mixing and matching both approaches could be useful.
From my tests, this is currently not possible.
As an example, in the following scenario the rules provided to
useController
in the component<Field>
are completely ignored.Submitting the form will not execute the validation rules for “lastName”.
https://codesandbox.io/s/react-hook-form-resolver-forked-ol5xb
I'm still kinda new to react-hook-form, hopefully I'm not proposing anything too crazy.
Beta Was this translation helpful? Give feedback.
All reactions