-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat(conform-react): custom revalidation #127
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Deploying with Cloudflare Pages
|
This is definitely something that we need 👀 |
This is ready to be merged and released. The only thing that stop me is deciding a proper default for const [form, { email, password }] = useForm({
// setting these everywhere (?)
shouldValidate: 'onBlur',
shouldRevalidate: 'onInput',
}); What do you think? @danestves |
From a progressive enhancement view I prefer to default always to on submit, why? I really think most of the user will use just the default and only a few will change it to onInput, at enterprise level most of the devs will use the onSubmit @edmundhung |
@danestves For first submission, yes. I am fine having Maybe it was a misconception I had. But I used to have all my forms revalidating fields with error as I type and as it gives user an instant feedback on whether the error they had is resolved or not. This is the same as react-hook-form. They used Another approach could be having a different default based on whether client validation is defined or not. If defined, default to |
It depends on the type of application that you want to build, for example, in two of our apps that behavior doesn't like to product and designers, and from a A/B test, users want the validation only on submit 😅 cc @edmundhung |
I think this is the way 👀 we just delete the client validation to avoid having client validation and depend entirely on the server (project requirement 😅) cc @edmundhung |
c7423ca
to
bfa210e
Compare
@danestves I am actually convinced to have both config default to I don't have much changed yet so I feel a bit bad if I bump the major version to 0.7 now. I might keep it default to |
Sounds really good! Like that approach, actually. Like the 10x engineers say, LGTM |
LGTM! |
Resolves #125
This introduces two new config on the
useForm
hooks: