Open
Description
Consider a module Test.res
with the following code:
let context = React.createContext(0)
module ContextProvider = {
let make = React.Context.provider(context)
}
@react.component
let make = (~children) => {
<ContextProvider value=42> {children} </ContextProvider>
}
Without JSX preserve mode enabled, the compiler output is (correct):
function Test(props) {
return JsxRuntime.jsx(make, {
value: 42,
children: props.children
});
}
With JSX preserve mode:
function Test(props) {
return <make value={42}>
{props.children}
</make>;
}
However, make
is not a valid React component name as it is not uppercase.