Created
November 17, 2018 17:52
-
-
Save sag1v/6e5a4b870279d1fe3b6b2db94d0c8546 to your computer and use it in GitHub Desktop.
react integration with other applications article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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