Skip to content

Instantly share code, notes, and snippets.

@andreymakaroff
Created January 22, 2019 11:10
Show Gist options
  • Save andreymakaroff/cb7ea433b230cdf6e7e554faf1b1d2da to your computer and use it in GitHub Desktop.
Save andreymakaroff/cb7ea433b230cdf6e7e554faf1b1d2da to your computer and use it in GitHub Desktop.
componentDidMount() {
this.subs = [
this.props.navigation.addListener('didFocus', () => this.didFocus()),
this.props.navigation.addListener('willBlur', () => this.willBlur()),
];
}
componentWillUnmount() {
this.subs.forEach(sub => sub.remove());
this.willBlur();
}
didFocus() {
//bla
}
willBlur() {
//bla
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment