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