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

issue: UseFormReturn Typescript Crash #11906

Closed
1 task done
JesusFTG opened this issue May 20, 2024 · 1 comment
Closed
1 task done

issue: UseFormReturn Typescript Crash #11906

JesusFTG opened this issue May 20, 2024 · 1 comment

Comments

@JesusFTG
Copy link

JesusFTG commented May 20, 2024

Version Number

7.51.4

Codesandbox/Expo snack

Sandbox

Note: When you open the sandbox, go to Test component and check how the TS server crashes...

You can experience this in VSCODE too

Steps to reproduce

  1. Create a wrapper component with const {form} = useForm() hook
  2. Create an internal component with fieldValues receiving the UseFormReturn type
export function Test<T extends UseFormReturn<T>>({
  form,
}: {
  form: T extends UseFormReturn<T> ? UseFormReturn<T> : UseFormReturn<T>;
}) {
  1. Check how Typescript server crashes and it doesn't load any type (stuck on loading...)
image

Expected behaviour

The UseFormReturn type shouldn't crash the TS server

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049
Copy link
Member

Doesn't work as a generate component.

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

No branches or pull requests

2 participants