Skip to content

Instantly share code, notes, and snippets.

@marg51
Created January 16, 2017 15:17
Show Gist options
  • Save marg51/2e5bbff28c5b43f16e06e1b46a0e702f to your computer and use it in GitHub Desktop.
Save marg51/2e5bbff28c5b43f16e06e1b46a0e702f to your computer and use it in GitHub Desktop.
class App extends Component {
componentDidMount() {
this.refs.nav.navigator.navigationContext.addListener("willfocus", () => {
// do something smart, ie. close all modals, update your redux state, whatever
})
}
render() {
return (
<View style={styles.container}>
<NavigatorIOS
ref="nav"
initialRoute={...}/>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment