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

Nested array/object types 3+ deep can break typechecking for smaller nested types across the entire file #11536

Closed
1 task done
prophetitaly opened this issue Feb 21, 2024 · 2 comments

Comments

@prophetitaly
Copy link

Version Number

7.50.1

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/distracted-pond-fljrf4

Steps to reproduce

Describe the bug
I have a type with some fields that are deeply nested. If I assign that type to a variable there are no problems accessing or declaring its fields, but when I navigate the type's field from a useFormReturn.setValue() method I encounter the intellisense error that says "Type instantiation is excessively deep and possibly infinite".
The problem seems related to the way in which it accesses the properties and navigates throung the arrays of objects.
For example the string "subItem.0.name" is seen as a possibility that differs from "subItem.1.name" in the typescript intellisense.

To reproduce
I have created a simplified version of my project at codesandbox. To check the error just uncomment Example 1 and see that TypeScript intellisense is not working anymore.

Expected behaviour

I am expecting the navigation inside "formLogic: useFormReturn" in the same way as in the type in which each object of an array is seen in the same way.

Am I using it in a wrong way? Or is this library non intended for deeply nested objects?
Screenshot from 2024-02-21 17-24-38

What browsers are you seeing the problem on?

Firefox, Chrome, Edge

Relevant log output

No response

Code of Conduct

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

@bluebill1049 just for information, is there any possibility to have this behaviour fixed? It’s a TS issue or something bad happens within the library?

@alessiomatricardi
Copy link

Seems that #11019 patch solves the issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 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

3 participants