I am trying to build BuckleScript bindings for a ReactJS library that has a lot of ReactJS components accepting other ReactJS components as children. My first attempt at building the bindings is to create a binding for the parent element and for the child element, but then when the app runs, the parent element receives the ReasonReact version of the children instead of the ReactJS version and the app breaks. Any ideas on the proper way to build this? Should I convert the ReasonReact component back into ReactJS?
e.g.
/* MyComponent.re */
let component = ReasonReact.statelessComponent("MyComponent.re");
let make = _children => {
...component,
render: _self =>
<div>
<BsMyReactJsLibrary.Parent>
<BsMyReactJsLibrary.Child>
</BsMyReactJsLibrary.Parent>
</div>,
};
/* BsMyReactJsLibrary/src/Child.re */
[@bs.module "my-react-js-library"]
external reactJsChild : ReasonReact.reactClass = "ReactJsChild";
let make = (...) => ReasonReact.wrapJsForReason(...);