Skip to content

Instantly share code, notes, and snippets.

@sag1v
Created November 17, 2018 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sag1v/71eebbe5e5ef267085b8d7c4f7b3f773 to your computer and use it in GitHub Desktop.
Save sag1v/71eebbe5e5ef267085b8d7c4f7b3f773 to your computer and use it in GitHub Desktop.
react integration with other applications article
window.ReactCounter = {
mount: (props) => {
const el = document.getElementById('counter-app');
ReactDOM.render(<Counter {...props} />, el);
},
unmount: () => {
const el = document.getElementById('counter-app');
ReactDOM.unmountComponentAtNode(el);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment