How to use the @react-navigation/core.SwitchActions.JUMP_TO function in @react-navigation/core

To help you get started, we’ve selected a few @react-navigation/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keybase / client / shared / fs / common / hooks.tsx View on Github external
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())
        }
      })
    }
github keybase / client / shared / fs / common / hooks.tsx View on Github external
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())
        }
      })
    }