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

InstanceType doesn't work for components with generic #3593

Closed
avinean opened this issue Sep 26, 2023 · 5 comments
Closed

InstanceType doesn't work for components with generic #3593

avinean opened this issue Sep 26, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@so1ve
Copy link
Member

so1ve commented Sep 26, 2023

Duplicate of #3206

@so1ve so1ve marked this as a duplicate of #3206 Sep 26, 2023
@so1ve so1ve closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2023
@so1ve
Copy link
Member

so1ve commented Sep 26, 2023

Solution: You should use ComponentExposed from the vue-component-type-helpers packages instead of TypeScript's built-in ReturnType or InstanceType utilities since volar defines generic components as functional components.

@so1ve so1ve added the duplicate This issue or pull request already exists label Sep 26, 2023
@avinean
Copy link
Author

avinean commented Sep 26, 2023

@so1ve
This worths to be mentioned in docs

@cernymatej
Copy link

@so1ve Why not include the ComponentExposed type in vue? Since it already has some utility types, I don' think it would be a bad idea... https://vuejs.org/api/utility-types

@so1ve
Copy link
Member

so1ve commented Dec 1, 2023

@cernymatej vuejs/core#5408 vuejs/core#9556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants