Skip to content

Commit 0290878

Browse files
committed
stringToComponent type that works with ppx
1 parent 5478bca commit 0290878

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ReactDOM.res

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,8 +2100,9 @@ module Props = {
21002100

21012101
include Props
21022102

2103-
// As we've removed `ReactDOMRe.createElement`, this enables patterns like
2104-
// React.createElement(ReactDOM.stringToComponent(multiline ? "textarea" : "input"), ...)
2105-
external stringToComponent: string => React.component<domProps> = "%identity"
2103+
// Used by the ppx to generate primitive components like "div".
2104+
// Intentionally unsafe because typechecking is enforced by the ppx.
2105+
@deprecated("Please use JSX syntax directly.")
2106+
external stringToComponent: string => React.component<'a> = "%identity"
21062107

21072108
module Style = ReactDOMStyle

0 commit comments

Comments
 (0)