-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[@mantine/form] make Values and TransformedValues covariant #8198
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
base: master
Are you sure you want to change the base?
Conversation
This allows passing a form to a func which accepts a form with only selected fields of the original form Signed-off-by: Jan Vollmer <[email protected]>
Signed-off-by: Jan Vollmer <[email protected]>
Signed-off-by: Jan Vollmer <[email protected]>
Signed-off-by: Jan Vollmer <[email protected]>
Signed-off-by: Jan Vollmer <[email protected]>
|
I also looked into improved inference and value passing for the TransformValues / TransformedValues type, but I think for that TransformValues must be removed in favor of using only TransformedValues. But that would be a breaking change. I could start to create a draft PR for v9 though if there is interest. |
|
@rtivital could you already take a look at this PR? Would be happy about any feedback. |
|
Yes, I've reviewed it, but I do not fully understand the new TS syntax ( |
|
Okay, take your time 👍🏻 Thanks for letting me know. |
This allows type-safely passing a form to a func which accepts a form with only selected fields of the original form.
Here an example:
Related discussions:
This is just a proposal. Feel free to close the PR if you'd like.
I needed to create a new UseFormReturnType, but kept the old one around so that no breaking changes are made.
Edit: It is possible without an extra type