@@ -28,17 +28,23 @@ external createElementVariadic:
28
28
(component (' props ), ' props , array (element )) => element =
29
29
"createElement" ;
30
30
31
- [@ bs . module "react" ] [@ deprecated "Please use JSX syntax directly." ]
32
- external jsxKeyed : (component (' props ), ' props , string ) => element = "jsx" ;
31
+ [@ bs . module "react/jsx-runtime" ]
32
+ external jsxKeyed :
33
+ (component (' props ), ' props , ~key : string =?, unit ) => element =
34
+ "jsx" ;
33
35
34
- [@ bs . module "react" ] [ @ deprecated "Please use JSX syntax directly. " ]
36
+ [@ bs . module "react/jsx-runtime " ]
35
37
external jsx : (component (' props ), ' props ) => element = "jsx" ;
36
38
37
- [@ bs . module "react" ] [ @ deprecated "Please use JSX syntax directly. " ]
39
+ [@ bs . module "react/jsx-runtime " ]
38
40
external jsxs : (component (' props ), ' props ) => element = "jsxs" ;
39
41
40
- [@ bs . module "react" ] [@ deprecated "Please use JSX syntax directly." ]
41
- external jsxsKeyed : (component (' props ), ' props , string ) => element = "jsxs" ;
42
+ [@ bs . module "react/jsx-runtime" ]
43
+ external jsxsKeyed :
44
+ (component (' props ), ' props , ~key : string =?, unit ) => element =
45
+ "jsxs" ;
46
+
47
+ [@ bs . module "react/jsx-runtime" ] external jsxFragment : ' element = "Fragment" ;
42
48
43
49
type ref (' value ) = {mutable current: 'value};
44
50
@@ -120,24 +126,23 @@ external memoCustomCompareProps:
120
126
121
127
module Fragment = {
122
128
[@ bs . obj ]
123
- external makeProps :
124
- (~ children : element , ~ key : ' key =? , unit ) => {. "children" : element } ;
129
+ external makeProps : (~ children : element , unit ) => {. "children" : element } ;
130
+
125
131
[@ bs . module "react" ]
126
132
external make : component ({. "children": element }) = "Fragment" ;
127
133
};
128
134
129
135
module StrictMode = {
130
136
[@ bs . obj ]
131
- external makeProps :
132
- (~children : element , ~key : ' key =?, unit ) => {. "children": element };
137
+ external makeProps : (~children : element , unit ) => {. "children": element };
133
138
[@ bs . module "react" ]
134
139
external make : component ({. "children": element }) = "StrictMode" ;
135
140
};
136
141
137
142
module Suspense = {
138
143
[@ bs . obj ]
139
144
external makeProps :
140
- (~children : element =?, ~fallback : element =?, ~ key : ' key =? , unit ) =>
145
+ (~children : element =?, ~fallback : element =?, unit ) =>
141
146
{
142
147
.
143
148
"children": option (element ),
@@ -153,35 +158,6 @@ module Suspense = {
153
158
"Suspense" ;
154
159
};
155
160
156
- /* Experimental React.SuspenseList */
157
- module SuspenseList = {
158
- type revealOrder ;
159
- type tail ;
160
- [@ bs . obj ]
161
- external makeProps :
162
- (
163
- ~children : element =?,
164
- ~revealOrder : [ | ` forwards | ` backwards | ` together ] =?,
165
- ~tail : [ | ` collapsed | ` hidden ] =?,
166
- unit
167
- ) =>
168
- {
169
- .
170
- "children": option (element ),
171
- "revealOrder": option (revealOrder ),
172
- "tail": option (tail ),
173
- };
174
-
175
- [@ bs . module "react" ]
176
- external make :
177
- component ({
178
- .
179
- "children": option (element ),
180
- "revealOrder": option (revealOrder ),
181
- "tail": option (tail ),
182
- }) =
183
- "SuspenseList" ;
184
- };
185
161
/* HOOKS */
186
162
187
163
/*
@@ -211,6 +187,16 @@ external useReducerWithMapState:
211
187
(' state , ' action => unit ) =
212
188
"useReducer" ;
213
189
190
+ [@ bs . module "react" ]
191
+ external useSyncExternalStore :
192
+ (
193
+ ~subscribe : [@ bs . uncurry ] (unit => unit ),
194
+ ~getSnapshot : [@ bs . uncurry ] (unit => ' snapshot ),
195
+ ~getServerSnapshot : [@ bs . uncurry ] (unit => ' snapshot )=?
196
+ ) =>
197
+ ' snapshot =
198
+ "useSyncExternalStore" ;
199
+
214
200
[@ bs . module "react" ]
215
201
external useEffect : ([@ bs . uncurry ] (unit => option (unit => unit ))) => unit =
216
202
"useEffect" ;
@@ -254,6 +240,50 @@ external useEffect7:
254
240
unit =
255
241
"useEffect" ;
256
242
243
+ [@ bs . module "react" ]
244
+ external useInsertionEffect :
245
+ ([@ bs . uncurry ] (unit => option (unit => unit ))) => unit =
246
+ "useInsertionEffect" ;
247
+ [@ bs . module "react" ]
248
+ external useInsertionEffect0 :
249
+ ([@ bs . uncurry ] (unit => option (unit => unit )), [@ bs . as { json | []| json } ] _ ) =>
250
+ unit =
251
+ "useInsertionEffect" ;
252
+ [@ bs . module "react" ]
253
+ external useInsertionEffect1 :
254
+ ([@ bs . uncurry ] (unit => option (unit => unit )), array (' a )) => unit =
255
+ "useInsertionEffect" ;
256
+ [@ bs . module "react" ]
257
+ external useInsertionEffect2 :
258
+ ([@ bs . uncurry ] (unit => option (unit => unit )), (' a , ' b )) => unit =
259
+ "useInsertionEffect" ;
260
+ [@ bs . module "react" ]
261
+ external useInsertionEffect3 :
262
+ ([@ bs . uncurry ] (unit => option (unit => unit )), (' a , ' b , ' c )) => unit =
263
+ "useInsertionEffect" ;
264
+ [@ bs . module "react" ]
265
+ external useInsertionEffect4 :
266
+ ([@ bs . uncurry ] (unit => option (unit => unit )), (' a , ' b , ' c , ' d )) => unit =
267
+ "useInsertionEffect" ;
268
+ [@ bs . module "react" ]
269
+ external useInsertionEffect5 :
270
+ ([@ bs . uncurry ] (unit => option (unit => unit )), (' a , ' b , ' c , ' d , ' e )) =>
271
+ unit =
272
+ "useInsertionEffect" ;
273
+ [@ bs . module "react" ]
274
+ external useInsertionEffect6 :
275
+ ([@ bs . uncurry ] (unit => option (unit => unit )), (' a , ' b , ' c , ' d , ' e , ' f )) =>
276
+ unit =
277
+ "useInsertionEffect" ;
278
+ [@ bs . module "react" ]
279
+ external useInsertionEffect7 :
280
+ (
281
+ [@ bs . uncurry ] (unit => option (unit => unit )),
282
+ (' a , ' b , ' c , ' d , ' e , ' f , ' g )
283
+ ) =>
284
+ unit =
285
+ "useInsertionEffect" ;
286
+
257
287
[@ bs . module "react" ]
258
288
external useLayoutEffect :
259
289
([@ bs . uncurry ] (unit => option (unit => unit ))) => unit =
@@ -329,7 +359,7 @@ external useMemo7:
329
359
([@ bs . uncurry ] (unit => ' any ), (' a , ' b , ' c , ' d , ' e , ' f , ' g )) => ' any =
330
360
"useMemo" ;
331
361
332
- /* This is used as return values */
362
+ /* This is used as return values */
333
363
type callback (' input , ' output ) = 'input => 'output;
334
364
335
365
[@ bs . module "react" ]
@@ -379,6 +409,9 @@ external useCallback7:
379
409
external useContext : Context . t (' any ) => ' any = "useContext" ;
380
410
381
411
[@ bs . module "react" ] external useRef : ' value => ref (' value ) = "useRef" ;
412
+ [@ bs . module "react" ] external useId : unit => string = "useId" ;
413
+
414
+ [@ bs . module "react" ] external useDeferredValue : ' a => ' a = "useDeferredValue" ;
382
415
383
416
[@ bs . module "react" ]
384
417
external useImperativeHandle0 :
@@ -523,16 +556,18 @@ module Uncurried = {
523
556
"useCallback" ;
524
557
};
525
558
526
- type transitionConfig = {timeoutMs: int };
527
-
528
559
[@ bs . module "react" ]
529
- external useTransition :
530
- (~config : transitionConfig =?, unit ) =>
531
- (callback (callback (unit , unit ), unit ), bool ) =
560
+ external useTransition : unit => (bool , callback (callback (unit , unit ), unit )) =
532
561
"useTransition" ;
533
562
563
+ [@ bs . module "react" ] external use : Js . Promise . t (' a ) => ' a = "use" ;
564
+
534
565
[@ bs . set ]
535
566
external setDisplayName : (component (' props ), string ) => unit = "displayName" ;
536
567
537
568
[@ bs . get ] [@ bs . return nullable]
538
569
external displayName : component (' props ) => option (string ) = "displayName" ;
570
+
571
+ [@ bs . module "react" ]
572
+ external useDebugValue : (' value , ~format : ' value => string =?, unit ) => unit =
573
+ "useDebugValue" ;
0 commit comments