defineComponent had type error
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
//
What is expected?
//type error
defineComponent(
(props:{},ctx:SetupContext<[],SlotsType<{foo:string}>>)=>{
return ()=>h('div')
}
)
What is actually happening?
Type '{ attrs: Data; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: (exposed?: Record<string, any> | undefined) => void; }' is not assignable to type '{ attrs: Data; slots: Readonly<{ foo: Slot<string>; }>; emit: (event: never, ...args: any[]) => void; expose: (exposed?: Record<string, any> | undefined) => void; }'.
System Info
No response
Any additional comments?
No response
Closing this, explanation here
TLDR: This is just type usage but there's need for the runtime information to also be provided, since the usage from the docs is not being followed, this is not an error or bug.