How to use the react-native-router-flux.Actions.state 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 CodeRabbitYu / react-native-template / app / Router.js View on Github external
const onBackPress = () => {
    console.log(Actions.state);
    if (Actions.state.index !== 0) {
        return false
    }
    Actions.pop()
    return true
}
github HenryQuan / WoWs-Info-Re / WoWsInfo / src / core / util / SafeAction.js View on Github external
export const SafeAction = (screen, obj, max = 0) => {
  if (Actions.state.routes.filter(r => r.routeName === screen).length > max) {
    console.log(`${screen} rejected`);
  } else {
    Actions.push(screen, obj);
    console.log(`${screen} pushed`);
  }
};
github CodeRabbitYu / react-native-template / app / Router.js View on Github external
const onBackPress = () => {
    console.log(Actions.state);
    if (Actions.state.index !== 0) {
        return false
    }
    Actions.pop()
    return true
}
github HenryQuan / WoWs-Info-Re / WoWs_Info / src / router / MainRouter.windows.js View on Github external
onBackPress = () => {
    if (Actions.state.index == 0) return false;
    else Actions.pop(); return true;
  }
}
github CarGuo / GSYGithubAPP / app / components / widget / CustomTitle.js View on Github external
render() {
        let backButton = (Actions.state.routes[0].index === 0 || this.props.hideBackButton) ? 
github HenryQuan / WoWs-Info-Re / WoWsInfo / src / component / common / FloatingButton.js View on Github external
constructor(props) {
    super(props);

    let hasMenu = false;
    if (Actions.state.routes.findIndex(r => r.routeName === 'Menu') > 0) {
      hasMenu = true;
    }

    this.state = {
      menu: hasMenu,
      icon: hasMenu ? 'home' : require('../../img/Ship.png')
    }
  }
github HenryQuan / WoWs-Info-Re / WoWs_Info / src / router / MainRouter.js View on Github external
onBackPress = () => {
    if (Actions.state.index == 0) return false;
    else Actions.pop(); return true;
  }
}
github CarGuo / GSYGithubAPP / app / utils / backUtils.js View on Github external
return function () {
        if (Actions.state.routes[0].index > 0) {
            Actions.pop();
            return true;
        }
        ts = Date.now();
        if (!hasTip) {
            let handler = function () {
                let now = Date.now();
                if (now - ts < 1000) {
                    requestAnimationFrame(handler)
                } else {
                    hasTip = false
                }
            };
            handler();
            hasTip = true;
            Toast(I18n("doublePressExit"));
github CarGuo / GSYGithubAPP / app / components / LoginPage.js View on Github external
onClose() {
        if (Actions.state.index === 0) {
            return false;
        }
        Animated.timing(this.state.opacity, {
            duration: animaTime,
            toValue: 0,
        }).start(Actions.pop());
        return true;

    }