Skip to content

Instantly share code, notes, and snippets.

@sag1v
Created November 17, 2018 17:52
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/6e5a4b870279d1fe3b6b2db94d0c8546 to your computer and use it in GitHub Desktop.
Save sag1v/6e5a4b870279d1fe3b6b2db94d0c8546 to your computer and use it in GitHub Desktop.
react integration with other applications article
componentDidUpdate(prevProps, prevState) {
const { showCounter } = this.state;
if (prevState.showCounter !== showCounter) {
if(showCounter){
window.ReactCounter.mount({title: 'Whaaa! cool'});
} else{
window.ReactCounter.unmount();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment