How to use the react-native-router-flux.Actions.popTo function in react-native-router-flux

To help you get started, we’ve selected a few react-native-router-flux 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 HenryQuan / WoWs-Info-Re / WoWsInfoMac / src / component / common / FooterButton.js View on Github external
pressEvent() {
    const { icon } = this.props;
    if (icon === 'settings') SafeAction('Settings');
    else if (icon === 'arrow-back') {
      Actions.pop();
      if (Actions.state.routes.length === 2) {
        setTimeout(() => Actions.refresh(), 1000);
      }
    } else if (icon === 'home') {
      Actions.popTo('Menu');
      // Clear last location
      setLastLocation('');
      setTimeout(() => Actions.refresh(), 1000);
    } else SafeAction('Search');
  }
}
github crownstone / CrownstoneApp / js / util / Back.ts View on Github external
export const BackAction = function(popToName?) {
  try {
    if (popToName) {
      // account for the differences in routers here, not in every usage of this.
      // We use the iOS key names in the app code.
      if (popToName === 'sphereOverview') {
        if (Platform.OS === 'android') {
          popToName = 'drawer'
        }
      }
      Actions.popTo(popToName)
    }
    else {
      Actions.pop();
    }
  } catch (popErr) {
    LOGe.info("Pop error:", popErr);
  }
};
github HenryQuan / WoWs-Info-Re / WoWsInfo / src / component / common / FloatingButton.js View on Github external
navigate() {
    const { menu } = this.state;
    if (menu) {
      // Pop to menu 
      Actions.popTo('Menu');
    } else if (Actions.currentScene !== 'Menu') {
      // Add guard so that it wont push twice]
      Actions.Menu();
    }
  }
}
github mattermost / mattermost-mobile / src / components / logout.js View on Github external
componentWillReceiveProps(nextProps) {
        if (this.props.logout.status === 'fetching' &&
          nextProps.logout.status === 'fetched') {
            Routes.popTo('goToSelectServer');
        }
    }
github EdgeApp / edge-react-gui / src / components / Main.ui.js View on Github external
if (this.isCurrentScene(Constants.LOGIN)) {
      return false
    }
    if (this.isCurrentScene(Constants.WALLET_LIST_SCENE)) {
      if (this.backPressedOnce) {
        this.props.logout()
      } else {
        this.backPressedOnce = true
        showToast(s.strings.back_button_tap_again_to_exit).then(() => {
          this.backPressedOnce = false
        })
      }
      return true
    }
    if (this.isCurrentScene(Constants.EXCHANGE_QUOTE_SCENE)) {
      Actions.popTo(Constants.EXCHANGE_SCENE)
      return true
    }
    if (this.isCurrentScene(Constants.PLUGIN_VIEW)) {
      handlePluginBack()
      return true
    }
    Actions.pop()
    return true
  }
}
github EdgeApp / edge-react-gui / src / components / scenes / CreateWalletReviewScene.js View on Github external
            onDone={() => Actions.popTo(WALLET_LIST_SCENE)}
            image={<img style="{[styles.currencyLogo,">}
github EdgeApp / edge-react-gui / src / actions / CreateWalletActions.js View on Github external
.catch(async error => {
      await showModal(errorModal(s.strings.create_wallet_failed, error))
      Actions.popTo(Constants.WALLET_LIST_SCENE)
      dispatch({ type: 'UI/WALLETS/CREATE_WALLET_FAILURE' })
    })
}