import {
h,
defineComponent,
+ DefineComponent,
ref,
Fragment,
Teleport,
message: '1'
})
})
+
+// #5431
+describe('h should work with multiple types', () => {
+ const serializers = {
+ Paragraph: 'p',
+ Component: {} as Component,
+ DefineComponent: {} as DefineComponent
+ }
+
+ const sampleComponent = serializers['' as keyof typeof serializers]
+
+ h(sampleComponent)
+ h(sampleComponent, {})
+ h(sampleComponent, {}, [])
+})
children?: RawChildren | RawSlots
): VNode
+// catch all types
+export function h(type: string | Component, children?: RawChildren): VNode
+export function h<P>(
+ type: string | Component<P>,
+ props?: (RawProps & P) | ({} extends P ? null : never),
+ children?: RawChildren | RawSlots
+): VNode
+
// Actual implementation
export function h(type: any, propsOrChildren?: any, children?: any): VNode {
const l = arguments.length