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: useFieldArray doesn't infer the type of fields when the control prop is not passed. #11687

Closed
1 task done
ArianHamdi opened this issue Mar 18, 2024 · 0 comments
Closed
1 task done

Comments

@ArianHamdi
Copy link

Version Number

7.51.0

Codesandbox/Expo snack

https://codesandbox.io/p/devbox/kk9zwc?migrateFrom=dlk4gv

Steps to reproduce

  1. Hover over fields in useFieldArray that doesn't have a control prop in FieldArray component.
  2. The types are not inferred correctly.

Expected behaviour

If I pass a generic to useFieldArray, it infer fields type correctly, and it also works fine if I pass control. However, it doesn't infer types when we simply call useFieldArray within FormProvider without passing a generic. I just want to know if this is the expected behavior and how TypeScript operates. If yes, I would appreciate a brief note on this in the documentation.

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 bluebill1049 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants