Open
Description
https://forum.rescript-lang.org/t/call-for-help-2-test-jsx-v4/3781/22?u=moondaddi
As of JSX v4, the component can be written without @react.component
. The issue came from the binding to the component with external.
type props<'msg> = {msg: 'msg}
@module("@foo/bar")
external make: props<_> => React.element = "SomeComponent"
// output
React.createElement((function (prim) {
return Bar.SomeComponent(prim);
}), {
msg: "!!!"
})
// expected
React.createElement(Bar.SomeComponent(prim), {
msg: "!!!"
})
The output after transformation @react.component
is different from the above.
type props<'msg> = {
msg: 'msg,
}
@module("@foo/bar")
external make: React.componentLike<props<string>, React.element> = "SomeComponent"
The generated js output gets different between componentLike<'props, element>
and props<_> => React.element
.
Metadata
Metadata
Assignees
Labels
No labels