-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate validation
in <Form>
#1434
Labels
Comments
This is a great idea. To keep it backwards compatible, I'd like us to go with your recommend option 2. Will see if we can link this together with #2270 |
Note that the names of the types have changed: https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#changes-13
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
<Form>
component takes avalidation
prop, but it's really so much more. It's passed straight in to react-hook-form'suseForm
and can so take all the available config options, not just validation related.This should be reflected in the name of the variable. Something like
formOptions
would fit with the already existingformMethods
. The names of the respective TS types areUseFormOptions
andUseFormMethods
.The prop is used in the tutorial like this:
So it does read very well. Better than
formOptions={{ mode: 'onBlur' }}
would.Going forward I see two options
validation
and point people towardsformOptions
insteadvalidation
, but make it only take themode
parameter (possibly alsoreValidateMode
as that also has to do with validation). And then additionally addformOptions
for controlling everything.This is the list of everything you can pass to
useForm
The text was updated successfully, but these errors were encountered: