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
Fix data param in handleSubmit when TTransformedValues is a union type #11420
Fix data param in handleSubmit when TTransformedValues is a union type #11420
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
041b367
to
2f004e3
Compare
@@ -769,6 +765,7 @@ export type BatchFieldArrayUpdate = < | |||
export type Control< | |||
TFieldValues extends FieldValues = FieldValues, | |||
TContext = any, | |||
TTransformedValues extends FieldValues = TFieldValues, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite adding new generic to Control
, this should not be a breaking change, because TTransformedValues
has a default value of TFieldValues
, so previous code that only specified TFieldValues
should still work as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ype (react-hook-form#11420) * Rewritten UseFormHandleSubmit to use default values in generics * Updated api-extractor report --------- Co-authored-by: Beier (Bill) <bluebill1049@hotmail.com>
… union type (react-hook-form#11420)" This reverts commit 6fee03c.
Proposed Changes
Replaces current
UseFormHandleSubmit
implementation with the one that relies on default values in generics. For more info see this comment in original issue: #11414 (comment)Fixes #11414
Type of change
Please delete options that are not relevant.
Checklist: