Skip to content

Commit 0e8d47d

Browse files
committed
Remove ReactDOMRe.createElementVariadic
It's actually not needed for react-jsx v3 usage
1 parent dc55455 commit 0e8d47d

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

src/legacy/ReactDOMRe.res

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
This module is kept for ReScript react-jsx <= v3 compatibility
2+
This module is kept for ReScript react-jsx v3 compatibility
33
We removed all functionality that is not needed for JSX usage
44
**/
55

@@ -19,23 +19,3 @@ external createDOMElementVariadic: (
1919
@bs.splice @bs.val @bs.module("react")
2020
external createElement: (string, ~props: props=?, array<React.element>) => React.element =
2121
"createElement"
22-
23-
/* Only wanna expose createElementVariadic here. Don't wanna write an interface file */
24-
include (
25-
/* Use varargs to avoid the ReactJS warning for duplicate keys in children */
26-
{
27-
@bs.val @bs.module("react")
28-
external createElementInternalHack: 'a = "createElement"
29-
30-
@bs.send
31-
external apply: ('theFunction, 'theContext, 'arguments) => 'returnTypeOfTheFunction = "apply"
32-
33-
let createElementVariadic = (domClassName, ~props=?, children) => {
34-
let variadicArguments =
35-
[Obj.magic(domClassName), Obj.magic(props)] |> Js.Array.concat(children)
36-
createElementInternalHack->apply(Js.Nullable.null, variadicArguments)
37-
}
38-
}: {
39-
let createElementVariadic: (string, ~props: props=?, array<React.element>) => React.element
40-
}
41-
)

src/legacy/ReasonReact.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
This module is only kept for react-jsx <= v3 compatibility
2+
This module is kept for ReScript react-jsx v3 compatibility
33
We removed all functionality that is not needed for JSX usage
44
**/
5+
56
@bs.module("react") external fragment: 'a = "Fragment"

0 commit comments

Comments
 (0)