@use-stall/types 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/react.d.ts +7 -12
package/package.json
CHANGED
package/src/utils/react.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type ReactFragment = Iterable<ReactNode>;
|
|
|
4
4
|
|
|
5
5
|
export interface ReactPortal {
|
|
6
6
|
key: string | null;
|
|
7
|
-
children: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
8
|
type: string | ComponentType<any>;
|
|
9
9
|
props: any;
|
|
10
10
|
}
|
|
@@ -19,21 +19,16 @@ export type ReactNode =
|
|
|
19
19
|
|
|
20
20
|
export interface ReactElement<P = any> {
|
|
21
21
|
type: string | ComponentType<P>;
|
|
22
|
-
props: P;
|
|
22
|
+
props: P & { children?: ReactNode }; // ← children must be here
|
|
23
23
|
key: string | null;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Matches React.ComponentType<P> exactly — accepts both function and class components.
|
|
28
|
-
*/
|
|
29
|
-
export type ComponentType<P = {}> =
|
|
30
|
-
| FunctionComponent<P>
|
|
31
|
-
| ComponentClass<P>;
|
|
32
|
-
|
|
33
26
|
export interface FunctionComponent<P = {}> {
|
|
34
|
-
(props: P): ReactElement<any> | null;
|
|
27
|
+
(props: P): ReactElement<any> | null;
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
export interface ComponentClass<P = {}> {
|
|
38
|
-
new(props: P): { render(): ReactNode };
|
|
39
|
-
}
|
|
31
|
+
new (props: P): { render(): ReactNode };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ComponentType<P = {}> = FunctionComponent<P> | ComponentClass<P>;
|