Skip to content
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

Default TTransformedValues generics to TFieldValues #11913

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kevinresol
Copy link

interface ControlledInputProps<
  T extends FieldValues,
  N extends FieldPath<T>,
+  U extends FieldValues = T,
 >  {
-  control: Control<T>;
+  control: Control<T, any, U>;
}

Copy link

codesandbox bot commented May 21, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@jedahu
Copy link

jedahu commented May 30, 2024

Having TTransformedValues extend TFieldValues means your schema resolver cannot parse to a different shaped type which is an undesirable limitation imo.

I have a PR here (#11951) which removes that constraint.

I've just added this PR's type test to it and it passes.

@kevinresol
Copy link
Author

kevinresol commented May 30, 2024

Having TTransformedValues extend TFieldValues means your schema resolver cannot parse to a different shaped type which is an undesirable limitation imo.

I have a PR here (#11951) which removes that constraint.

I've just added this PR's type test to it and it passes.

That is very true. But it is out of scope for this PR. Happy to update (if needed) when #11951 gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants