This happens in v12.0.0-beta.4
. I noticed this when migrating my code from v11 to v12.
Minimal code as follows:
Define an external component with a parameter using @as
:
module Xxx = {
@react.component
external make: (@as("something") ~foo: string) => React.element = "myfunc"
}
Then use it:
This compiles to the following with no error message:
JsxRuntime.jsx(myfunc, {
foo: "bar"
}),
This compiled in v11 to the following. In my opinion this should be still the correct result. (I am not aware of @as
being deprecated in external react components, but if so then an error would be appropriate)
JsxRuntime.jsx(myfunc, {
something: "bar"
}),