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

PartialDeep & error TS2589: Type instantiation is excessively deep and possibly infinite #295

Closed
merrywhether opened this issue Oct 16, 2021 · 0 comments · Fixed by #296
Closed

Comments

@merrywhether
Copy link
Contributor

merrywhether commented Oct 16, 2021

There is a known issue in TypeScript involving eager evaluation of recursive types in certain situations. We ran into this in our tests using PartialDeep on an element that included elemRef: Element in its props when we upgraded to TS 4.4; there must be a new recursive type definition somewhere in lib.dom now. The issue includes a suggested solution.

This TS playground illustrates both the problem and suggested fix for PartialDeep directly as well as the simpler PartialRecursive type from the TS issue.

@merrywhether merrywhether changed the title PartialDeep & error TS2589: Type instantiation is excessively deep and possibly infinite PartialDeep & error TS2589: Type instantiation is excessively deep and possibly infinite Oct 16, 2021
@merrywhether merrywhether changed the title PartialDeep & error TS2589: Type instantiation is excessively deep and possibly infinite PartialDeep & error TS2589: Type instantiation is excessively deep and possibly infinite Oct 17, 2021
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 a pull request may close this issue.

1 participant