-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React/JSX broken after external arity handling improvement #6880
Comments
@cristianoc I retested with latest master and am now getting JsxRuntime.jsx((function (prim) {
return ReactIntl.FormattedMessage(prim);
}), {
id: "test",
defaultMessage: "Test"
}); for the above example. This will still fail at runtime. |
It does look correct in the test in your PR, however. module React = {
type element = Jsx.element
type componentLike<'props, 'return> = 'props => 'return
type component<'props> = Jsx.component<'props>
@module("react/jsx-runtime")
external jsx: (component<'props>, 'props) => element = "jsx"
} If I do that, it works for me, too. |
Can you give me a super-quick repro in its own repo? |
Side note: I think the problem with |
@cristianoc https://github.com/cknitt/rescript-repro-6880 (It uses the npm package downloaded from CI here, you will have to adapt that accordingly: |
Great. I had a PR ready to go that simply implements things in a more robust way, and it seems to work: Can you try the full project? |
Works fine now 🎉! Thanks a lot! |
After #6874, I have the following problem:
compiles to
(which fails at runtime) instead of
I think the root cause is that
React.component
is not defined as an abstract type, but as'props => React.element
. @mununki tried to make it abstract in #6304, but hit a roadblock.Although I am also asking myself why the compiler needs to introduce that extra function now that it knows that the external is a function of arity 1.
The text was updated successfully, but these errors were encountered: