File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import {
2
2
type Component ,
3
3
type DefineComponent ,
4
4
Fragment ,
5
+ type FunctionalComponent ,
5
6
Suspense ,
6
7
Teleport ,
8
+ type VNode ,
7
9
defineComponent ,
8
10
h ,
9
11
ref ,
@@ -77,6 +79,19 @@ describe('h inference w/ Suspense', () => {
77
79
h ( Suspense , { onResolve : 1 } )
78
80
} )
79
81
82
+ declare const fc : FunctionalComponent <
83
+ {
84
+ foo : string
85
+ bar ?: number
86
+ onClick : ( evt : MouseEvent ) => void
87
+ } ,
88
+ [ 'click' ] ,
89
+ {
90
+ default : ( ) => VNode
91
+ title : ( scope : { id : number } ) => VNode
92
+ }
93
+ >
94
+ declare const vnode : VNode
80
95
describe ( 'h inference w/ functional component' , ( ) => {
81
96
const Func = ( _props : { foo : string ; bar ?: number } ) => ''
82
97
h ( Func , { foo : 'hello' } )
@@ -87,6 +102,24 @@ describe('h inference w/ functional component', () => {
87
102
h ( Func , { } )
88
103
// @ts -expect-error
89
104
h ( Func , { bar : 123 } )
105
+
106
+ h (
107
+ fc ,
108
+ { foo : 'hello' , onClick : ( ) => { } } ,
109
+ {
110
+ default : ( ) => vnode ,
111
+ title : ( { id } : { id : number } ) => vnode ,
112
+ } ,
113
+ )
114
+
115
+ h (
116
+ fc ,
117
+ { foo : 'hello' , onClick : ( ) => { } } ,
118
+ {
119
+ default : ( ) => vnode ,
120
+ title : ( { id } : { id : number } ) => vnode ,
121
+ } ,
122
+ )
90
123
} )
91
124
92
125
describe ( 'h support w/ plain object component' , ( ) => {
You can’t perform that action at this time.
0 commit comments