Skip to content

Instantly share code, notes, and snippets.

@jsergiu
Created November 27, 2016 21:16
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 jsergiu/7e34571df46c8aed3cac53e65a9519d4 to your computer and use it in GitHub Desktop.
Save jsergiu/7e34571df46c8aed3cac53e65a9519d4 to your computer and use it in GitHub Desktop.
class Greeting extends React.Component {
 componentDidMount() {
  window.MyApp.events.onEscape = this.closePopup;
 }
 componentWillUnmount() {
  window.MyApp.events.onEscape = null;
 }
 closePopup () { … }
render() { … }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment