@@ -5,50 +5,71 @@ open Fable.Core
55open Fable.Core .JsInterop
66open Browser.Types
77
8+ module internal ReactInternal =
9+
10+ [<Import( " createElement" , " react" ) >]
11+ let createElementWithChildren ( ``type`` : ReactNode , props : obj , [<ParamArray>] children : seq < ReactElement >): ReactElement = jsNative
12+
13+ [<Import( " createElement" , " react" ) >]
14+ let createElementWithChild ( ``type`` : ReactNode , props : obj , children : ReactElement ): ReactElement = jsNative
15+
16+ [<Import( " createElement" , " react" ) >]
17+ let createElementWithProps ( ``type`` : ReactNode , props : obj ): ReactElement = jsNative
18+
19+ [<Import( " createElement" , " react" ) >]
20+ let createElement ( ``type`` : ReactNode ): ReactElement = jsNative
21+
22+
23+ open ReactInternal
24+
825[<Erase>]
926type ReactLegacy =
1027
1128 static member inline createElement ( ``type`` : string , props : obj , children : seq < ReactElement >): ReactElement =
12- ( import " createElement " " react " )( `` type `` , props, children)
29+ createElementWithChildren (!^ `` type `` , props, children)
1330
1431 static member inline createElement ( ``type`` : string , props : obj , children : ReactElement ): ReactElement =
15- ( import " createElement " " react " )( `` type `` , props, children = children)
32+ createElementWithChild (!^ `` type `` , props, children)
1633
1734 static member inline createElement ( ``type`` : string , children : seq < ReactElement >): ReactElement =
18- ( import " createElement " " react " )( `` type `` , null , children = children)
35+ createElementWithChildren (!^ `` type `` , null , children)
1936
2037 static member inline createElement ( ``type`` : string , children : ReactElement ): ReactElement =
21- ( import " createElement " " react " )( `` type `` , null , children = children)
38+ createElementWithChild (!^ `` type `` , null , children)
2239
2340 static member inline createElement ( ``type`` : string , props : obj ): ReactElement =
24- ( import " createElement " " react " )( `` type `` , props)
41+ createElementWithProps (!^ `` type `` , props)
2542
2643 static member inline createElement ( ``type`` : ReactElement , props : obj , children : seq < ReactElement >): ReactElement =
27- ( import " createElement " " react " )( `` type `` , props, children = children)
44+ createElementWithChildren (!^ `` type `` , props, children)
2845 static member inline createElement ( ``type`` : ReactElement , props : obj , children : ReactElement ): ReactElement =
29- ( import " createElement " " react " )( `` type `` , props, children = children)
46+ createElementWithChild (!^ `` type `` , props, children)
3047
3148 static member inline createElement ( ``type`` : ReactElement , children : seq < ReactElement >): ReactElement =
32- ( import " createElement " " react " )( `` type `` , null , children = children)
49+ createElementWithChildren (!^ `` type `` , null , children)
3350 static member inline createElement ( ``type`` : ReactElement , children : ReactElement ): ReactElement =
34- ( import " createElement " " react " )( `` type `` , null , children = children)
51+ createElementWithChild (!^ `` type `` , null , children)
3552
3653 static member inline createElement ( ``type`` : ReactElement , props : obj ): ReactElement =
37- ( import " createElement " " react " )( `` type `` , props)
54+ createElementWithProps (!^ `` type `` , props)
3855
3956 static member inline createElement ( ``type`` : ReactNode , props : obj , children : seq < ReactElement >): ReactElement =
40- ( import " createElement" " react" )( `` type `` , props, children = children)
57+ createElementWithChildren( `` type `` , props, children)
58+
4159 static member inline createElement ( ``type`` : ReactNode , props : obj , children : ReactElement ): ReactElement =
42- ( import " createElement " " react " )( `` type `` , props, children = children)
60+ createElementWithChild ( `` type `` , props, children)
4361
4462 static member inline createElement ( ``type`` : ReactNode , children : seq < ReactElement >): ReactElement =
45- ( import " createElement " " react " )( `` type `` , null , children = children)
63+ createElementWithChildren ( `` type `` , null , children)
4664
4765 static member inline createElement ( ``type`` : ReactNode , children : ReactElement ): ReactElement =
48- ( import " createElement " " react " )( `` type `` , null , children = children)
66+ createElementWithChild ( `` type `` , null , children)
4967
5068 static member inline createElement ( ``type`` : ReactNode , props : obj ): ReactElement =
51- ( import " createElement" " react" )( `` type `` , props)
69+ createElementWithProps( `` type `` , props)
70+
71+ static member inline createElement ( ``type`` : ReactNode ): ReactElement =
72+ createElement( `` type `` )
5273
5374
5475 [<ImportMember( " react" ) >]
@@ -506,7 +527,7 @@ useLayoutEffect(() => {
506527 /// <param name =' children ' >The elements that will be rendered with additional
507528 /// checks and warnings.</param >
508529 static member StrictMode ( children : seq < ReactElement >) : ReactElement =
509- ReactLegacy.createElement( unbox< ReactNode> ( import " StrictMode" " react" ), children = children )
530+ ReactLegacy.createElement( unbox< ReactNode> ( import " StrictMode" " react" ), children)
510531
511532 /// <summary >
512533 /// Lets you define a component that is loaded dynamically. Which helps with code splitting.
0 commit comments