@@ -16,15 +16,18 @@ let component = Jsx.component
1616
1717%%private (
1818 @inline
19- let addKeyProp = (p : 'props , k : string ): 'props =>
20- Obj .magic (Js .Obj .assign (Obj .magic (p ), {"key" : k }))
19+ let addKeyProp = (~key : option <string >= ?, p : 'props ): 'props =>
20+ switch key {
21+ | Some (key ) => Obj .magic (Js .Obj .assign (Obj .magic (p ), {"key" : key }))
22+ | None => p
23+ }
2124)
2225
2326@module ("react" )
2427external createElement : (component <'props >, 'props ) => element = "createElement"
2528
26- let createElementWithKey = (component , props , key ) =>
27- createElement (component , addKeyProp (props , key ))
29+ let createElementWithKey = (~ key = ?, component , props ) =>
30+ createElement (component , addKeyProp (~ key ?, props ))
2831
2932@module ("react" )
3033external cloneElement : (element , 'props ) => element = "cloneElement"
@@ -36,20 +39,20 @@ external isValidElement: 'a => bool = "isValidElement"
3639external createElementVariadic : (component <'props >, 'props , array <element >) => element =
3740 "createElement"
3841
39- let createElementVariadicWithKey = (component , props , elements , key ) =>
40- createElementVariadic (component , addKeyProp (props , key ), elements )
42+ let createElementVariadicWithKey = (~ key = ?, component , props , elements ) =>
43+ createElementVariadic (component , addKeyProp (~ key ?, props ), elements )
4144
4245@module ("react/jsx-runtime" )
43- external jsxKeyed : (component <'props >, 'props , string ) => element = "jsx"
46+ external jsx : (component <'props >, 'props ) => element = "jsx"
4447
4548@module ("react/jsx-runtime" )
46- external jsx : (component <'props >, 'props ) => element = "jsx"
49+ external jsxKeyed : (component <'props >, 'props , ~ key : string = ?, @ ignore unit ) => element = "jsx"
4750
4851@module ("react/jsx-runtime" )
4952external jsxs : (component <'props >, 'props ) => element = "jsxs"
5053
5154@module ("react/jsx-runtime" )
52- external jsxsKeyed : (component <'props >, 'props , string ) => element = "jsxs"
55+ external jsxsKeyed : (component <'props >, 'props , ~ key : string = ?, @ ignore unit ) => element = "jsxs"
5356
5457type fragmentProps <'children > = {children : 'children }
5558
@@ -413,13 +416,13 @@ external useInsertionEffect7: (
413416
414417@module ("react" )
415418external useSyncExternalStore : (
416- ~subscribe : @uncurry (( unit => unit ) => (( . unit ) => unit )) ,
419+ ~subscribe : @uncurry (unit => unit , . unit ) => unit ,
417420 ~getSnapshot : @uncurry unit => 'state ,
418421) => 'state = "useSyncExternalStore"
419422
420423@module ("react" )
421424external useSyncExternalStoreWithServerSnapshot : (
422- ~subscribe : @uncurry (( unit => unit ) => (( . unit ) => unit )) ,
425+ ~subscribe : @uncurry (unit => unit , . unit ) => unit ,
423426 ~getSnapshot : @uncurry unit => 'state ,
424427 ~getServerSnapshot : @uncurry unit => 'state ,
425428) => 'state = "useSyncExternalStore"
0 commit comments