Generic Component vs defineExpose
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
In App.vue
the template ref to GenericComp.vue
is typed by InstanceType<typeof GenericComp>
but using this I get Typescript errors.
Type '<T extends MenuItem>(__VLS_props: Props & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: Pick<...> | undefined, __VLS_setup?: { ...; }) => VNode<...> & { ...; }' does not satisfy the constraint 'abstract new (...args: any) => any'.
Without using the InstanceType
type I get the error
Type '<T extends MenuItem>(__VLS_props: Props & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: Pick<...> | undefined, __VLS_setup?: { ...; }) => VNode<...> & { ...; }' does not satisfy the constraint 'abstract new (...args: any) => any'.
What is expected?
No typescript error.
What is actually happening?
I get a typescript error and cannot compile
System Info
No response
Any additional comments?
No response