Created
September 10, 2018 20:29
-
-
Save jbutko/f40faf7339210523347edef38ac1fd04 to your computer and use it in GitHub Desktop.
React Native: Leave screen callback React Navigation Tab Navigator
This file contains hidden or 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
const didBlurSubscription = this.props.navigation.addListener( | |
'didBlur', | |
payload => { | |
console.debug('didBlur', payload); | |
} | |
); | |
// Remove the listener when you are done | |
didBlurSubscription.remove(); | |
// Payload | |
{ | |
action: { type: 'Navigation/COMPLETE_TRANSITION', key: 'StackRouterRoot' }, | |
context: 'id-1518521010538-2:Navigation/COMPLETE_TRANSITION_Root', | |
lastState: undefined, | |
state: undefined, | |
type: 'didBlur', | |
}; | |
// via From https://stackoverflow.com/questions/49372508/leave-screen-callback-react-navigation-tab-navigator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment