Checking backward compatibility with JSX PPX V4
mununki opened this issue · 2 comments
This issue is only affected with JSX PPX V4.
Some of React components are disposed to be built error, e.g. React.Fragment, React.Suspense, etc. Because it is written without @react.component attribute, which is impossible to use in the self cycled module React.
module Fragment = {
@obj
external makeProps: (~children: element, ~key: 'key=?, unit) => {"children": element} = ""
@module("react")
external make: component<{
"children": element,
}> = "Fragment"
}I think that it is better to rewrite those components with @react.component attribute for the future migration not only for V4. My initial suggestion is to make those components to the separated module, such as RescriptReact.Fragment(leave the original components there as they are for backward compatibility). How about it?
EDIT: There was similarly rewriting #47
I'm going to add RescriptReact.Fragment, RescriptReact.Suspense, etc with jsx config update @@jsxConfig which enables to update config without changing the rest of the files in the project.