Skip to content

Commit 23f3573

Browse files
committed
Fix children type for Fragment, StrictMode and Suspense
1 parent 88689f6 commit 23f3573

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/React.res

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ external jsxs: (component<'props>, 'props) => element = "jsxs"
3939
@module("react/jsx-runtime")
4040
external jsxsKeyed: (component<'props>, 'props, ~key: string=?, @ignore unit) => element = "jsxs"
4141

42-
type fragmentProps<'children> = {children?: 'children}
42+
type fragmentProps = {children?: element}
4343

44-
@module("react/jsx-runtime") external jsxFragment: component<fragmentProps<'children>> = "Fragment"
44+
@module("react/jsx-runtime") external jsxFragment: component<fragmentProps> = "Fragment"
4545

4646
type ref<'value> = {mutable current: 'value}
4747

@@ -104,27 +104,27 @@ external memoCustomCompareProps: (
104104
@uncurry ('props, 'props) => bool,
105105
) => component<'props> = "memo"
106106

107-
@module("react") external fragment: 'a = "Fragment"
107+
@module("react") external fragment: component<fragmentProps> = "Fragment"
108108

109109
module Fragment = {
110-
type props<'children> = {key?: string, children: 'children}
110+
type props = {key?: string, children: element}
111111

112112
@module("react")
113-
external make: component<props<'children>> = "Fragment"
113+
external make: component<props> = "Fragment"
114114
}
115115

116116
module StrictMode = {
117-
type props<'children> = {key?: string, children: 'children}
117+
type props = {key?: string, children: element}
118118

119119
@module("react")
120-
external make: component<props<'children>> = "StrictMode"
120+
external make: component<props> = "StrictMode"
121121
}
122122

123123
module Suspense = {
124-
type props<'children, 'fallback> = {key?: string, children?: 'children, fallback?: 'fallback}
124+
type props = {key?: string, children?: element, fallback?: element}
125125

126126
@module("react")
127-
external make: component<props<'children, 'fallback>> = "Suspense"
127+
external make: component<props> = "Suspense"
128128
}
129129

130130
type dynamicallyImportedModule<'a> = {default: component<'a>}

0 commit comments

Comments
 (0)