-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Why Hookform resolver makes required fields optional? #683
Comments
Any update on this? |
Can you please provide an updated Codesandbox with your issue? |
simply hover on the methods like resolver to know what is wrong. I have screenshots attached of what method to hover on. |
I need a reproducible example to help you. Can you provide a Codesandbox or more details? |
Your CSB is not using the same version of RHF and resolvers as described in your issue. Please ensure consistency. |
This problem occur only when we don't use register and use controlled components by using control. I will share a CSB with control implementation. |
Describe the bug
Hookform Resolver is making types optional.
To Reproduce
Steps to reproduce the behavior:
In the onSubmit of form I get:
handleSubmit((data) => {onSubmit(data);})
The type that gets resolved is:
This is because the type that get resolved here is:
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
Expected behavior
The type should be inferred as required and not optional which is
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: