Interop with JS components and JSX3

reasonreact

#1

As per the docs (seen here https://github.com/reasonml/reason-react/blob/master/docs/interop.md, return ) it seems that the wrapper functions to facilitate interop with JavaScript components create JSX2 components.

We can also use JSX3 components inside JSX2 components as described https://github.com/reasonml/reason-react/blob/master/docs/jsx.md. But there doesn’t seem to be a way to use JSX2 components inside JSX3 components. This means that I can’t use the interop JSX2 component in my JSX3 components.

If I want to use this JavaScript component is my only option to rewrite my app with JSX2?

I’m not familiar with the inner workings of react/reasonreact. Is it possible for me to write my own helper function which can provide interop either between JS compoents and JSX3 or JSX2 and JSX3?


#2

I think this section on interop is more up to date.

As stated at the top of the doc you link to, the Record API is frozen etc. It means that in the age of hooks, it’s not exactly deprecated, but not particularly recommended. And wrapping plain JS components in the modern, hooks-based, JSX3 RR components is pretty trivial, as you can probably see.


#3

Ahh. I don’t know how I missed that page. Thanks for the link