Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
NavigationHooks.useNavigationEvents((e: NavigationEventPayload) => {
// On mobile stack actions cause willFocus and willBlur too, but they
// don't mean navigating into or away from the Fs tab. Could just be
// navigating inside the Fs tabn. So only trigger for JUMP_TO.
if (e.type === 'willFocus' && e.action.type === SwitchActions.JUMP_TO) {
dispatch(FsGen.createUserIn())
} else if (e.type === 'willBlur' && e.action.type === SwitchActions.JUMP_TO) {
dispatch(FsGen.createUserOut())
}
})
}
NavigationHooks.useNavigationEvents((e: NavigationEventPayload) => {
// On mobile stack actions cause willFocus and willBlur too, but they
// don't mean navigating into or away from the Fs tab. Could just be
// navigating inside the Fs tabn. So only trigger for JUMP_TO.
if (e.type === 'willFocus' && e.action.type === SwitchActions.JUMP_TO) {
dispatch(FsGen.createUserIn())
} else if (e.type === 'willBlur' && e.action.type === SwitchActions.JUMP_TO) {
dispatch(FsGen.createUserOut())
}
})
}