Skip to content

Commit 993b35b

Browse files
committed
Add warning for ReactDOMRe
1 parent ef5925f commit 993b35b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pages/docs/react/latest/elements-and-jsx.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ ReactDOMRe.createDOMElementVariadic("div", ~props=ReactDOM.domProps(~className="
190190

191191
The function above requires the `ReactDOM.domProps` constructor function, so ReScript can make sure that we are only passing valid dom props. You can find an exhaustive list of all available props in the [ReactDOM](https://github.com/reasonml/reason-react/blob/master/src/ReactDOM.re#L61) module.
192192

193+
**Warning:** The `ReactDOMRe` module will be removed in the next major `rescript-react` release, so use sparsely!
193194

194195
### Cloning Elements
195196

@@ -221,4 +222,3 @@ React.cloneElement(original, {
221222
The feature mentioned above could also replicate `props spreading`, a practise commonly used in ReactJS codebases, but we strongly discourage the usage due to its unsafe nature and its incorrectness (e.g. adding undefined extra props to a component doesn't make sense, and causes hard to find bugs).
222223

223224
In ReScript, we rather pass down required props explicitly to leaf components or use a renderProp instead. We introduced [JSX punning](/docs/manual/latest/jsx#punning) syntax to make the process of passing down props more convenient.
224-

0 commit comments

Comments
 (0)