How to bind generated bs.js file into existing file js file


#1

Hi all
I have a reason App.re file, that looks as following:

let component = ReasonReact.statelessComponent("App");

let make = (_children) => {
  ...component,
  render: _self => <div> {ReasonReact.stringToElement("Hello")} </div>
};  

the generated App.bs.js file looks as following:

// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as React from "react";
import * as ReasonReact from "reason-react/src/ReasonReact.js";

var component = ReasonReact.statelessComponent("App");

function make() {
  var newrecord = component.slice();
  newrecord[/* render */9] = (function () {
      return React.createElement("div", undefined, "Hello");
    });
  return newrecord;
}

export {
  component ,
  make ,
  
}
/* component Not a pure module */ . 

The files structure:

The question is, how bind the component from reason in index.js?

The content of `index.js`:  
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();  

Thanks


#2

See https://reasonml.github.io/reason-react/docs/en/interop.html