Skip to content

Instantly share code, notes, and snippets.

@ramubotsplash
Last active May 1, 2018 16:12
Show Gist options
  • Save ramubotsplash/69cb48f39fea4736cd0fe5efd99da718 to your computer and use it in GitHub Desktop.
Save ramubotsplash/69cb48f39fea4736cd0fe5efd99da718 to your computer and use it in GitHub Desktop.
ReactToJs
// FROM ReactJs
import React from 'react';
import ReactDOM from 'react-dom';
let rootEl = document.getElementById('botsplash-chat-root');
ReactDOM.render(
<HostApp
appId={appId}
serverUrl={serverUrl}
settings={settings}
...
/>,
rootEl,
);
// TO Js
let rootEl = document.getElementById('botsplash-chat-root');
app = new HostApp(rootEl, {
appId,
serverUrl,
settings,
....
});
app.componentDidMount();
app.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment