3
3
ReactElement ,
4
4
ReactNode ,
5
5
ReactType ,
6
+ ReactHTML ,
6
7
Attributes ,
7
8
} from 'react' ;
8
9
import { incorporate } from './incorporate' ;
@@ -16,7 +17,7 @@ type PropsLike<P> = P & PropsExtensions & Attributes;
16
17
type Children = string | Array < ReactNode > ;
17
18
18
19
function createElementSpreading < P = any > (
19
- type : ReactType < P > ,
20
+ type : ReactType < P > | keyof ReactHTML ,
20
21
props : PropsLike < P > | null ,
21
22
children : Children ,
22
23
) : ReactElement < P > {
@@ -28,7 +29,7 @@ function createElementSpreading<P = any>(
28
29
}
29
30
30
31
function hyperscriptProps < P = any > (
31
- type : ReactType < P > ,
32
+ type : ReactType < P > | keyof ReactHTML ,
32
33
props : PropsLike < P > ,
33
34
) : ReactElement < P > {
34
35
if ( ! props . sel ) {
@@ -39,14 +40,14 @@ function hyperscriptProps<P = any>(
39
40
}
40
41
41
42
function hyperscriptChildren < P = any > (
42
- type : ReactType < P > ,
43
+ type : ReactType < P > | keyof ReactHTML ,
43
44
children : Children ,
44
45
) : ReactElement < P > {
45
46
return createElementSpreading ( type , null , children ) ;
46
47
}
47
48
48
49
function hyperscriptPropsChildren < P = any > (
49
- type : ReactType < P > ,
50
+ type : ReactType < P > | keyof ReactHTML ,
50
51
props : PropsLike < P > ,
51
52
children : Children ,
52
53
) : ReactElement < P > {
@@ -58,7 +59,7 @@ function hyperscriptPropsChildren<P = any>(
58
59
}
59
60
60
61
export function h < P = any > (
61
- type : ReactType < P > ,
62
+ type : ReactType < P > | keyof ReactHTML ,
62
63
a ?: PropsLike < P > | Children ,
63
64
b ?: Children ,
64
65
) : ReactElement < P > {
0 commit comments