BuckleScript bindings for ReactJS components with ReactJS children

interop
reasonreact

#1

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(...);

#2

Never mind on this one. I had an error in the make function and I misinterpreted the failure. I forgot to pass the unit value to terminate the function with labeled arguments. In the compiled JavaScript, BuckleScript was returning a function instead of an object.

[@bs.obj] external makeProps : (
  ~someValue: string=?,
  unit
) => _ = "";

let make = (
  ~someValue=?,
  children,
) =>
ReasonReact.wrapJsForReason(
  ~reactClass=reactJsChild,
  ~props=makeProps(
    ~someValue?,
    () /* this is the line I forgot to include in the original broken code */
  ),
  children,
);