How to use the react-navigation.NavigationActions.reset function in react-navigation

To help you get started, we’ve selected a few react-navigation 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 l3wi / iotaMobile / app / main.js View on Github external
nullify = nextAppState => {
    console.log("App changed to: ", nextAppState);
    if (nextAppState === "inactive") {
      // Writing it 'null'
      this.setState({ pwd: stringToU8("000000000000000000000000") });
      // Removing it's refs do the GC can clean it
      delete this.state.pwd;
      // Construct a reset action for the naviggator
      const resetAction = NavigationActions.reset({
        index: 0,
        actions: [
          NavigationActions.navigate({
            routeName: "Initial"
          })
        ]
      });
      this.props.navigation.dispatch(resetAction);
      console.log("Key Cleaned & Rerouted to login");
    }
  };
github wangyijing130 / react-native-enterprise / src / login / loginPage.js View on Github external
import React, {Component} from 'react';
import {View, Text, StyleSheet, TextInput} from 'react-native';
import {connect} from 'react-redux'; // 引入connect函数
import * as loginAction from './loginAction';// 导入action方法
import {NavigationActions} from 'react-navigation';
import {THEME_BACKGROUND, THEME_LABEL, THEME_TEXT} from '../assets/css/color';
import CButton from '../common/button';

// 清空导航记录,跳转到首页
const resetAction = NavigationActions.reset({
    index: 0,
    actions: [
        NavigationActions.navigate({routeName: 'Main'})
    ]
});

class LoginPage extends Component {
    static navigationOptions = {
        header: null
    };


    mobile = '13510005217';
    password = '123456';

    constructor(props) {
github marrionluaka / KittyRescue / src / screens / HighScores / index.tsx View on Github external
_backHome = () => {
        this.props.navigation.dispatch(
            NavigationActions.reset({
            index: 0,
            actions: [
              NavigationActions.navigate({ routeName: "Home"}),
            ],
          })
        )
    }
github commaai / openpilot-apks / neossetup / js / screens / SetupTerms / SetupTerms.js View on Github external
handleSetupTermsCompleted: async () => {
        const termsVersion = await ChffrPlus.readParam(Params.KEY_LATEST_TERMS_VERSION);
        ChffrPlus.writeParam(Params.KEY_ACCEPTED_TERMS_VERSION, termsVersion);
        dispatch(NavigationActions.reset({
            index: 0,
            key: null,
            actions: [
                NavigationActions.navigate({
                    routeName: 'SetupPair',
                })
            ]
        }))
    },
    handleSetupTermsBackPressed: () => {
github TrustTheBoy / react-native-component-redux / src / page / Login / index.js View on Github external
onLogin = () => {
        this.props.showDialog();
        const resetAction = NavigationActions.reset({
            index: 0,
            actions: [NavigationActions.navigate({ routeName: 'RootScreen' })]
        });
        setTimeout(() => {
            this.props.hideDialog();
            InteractionManager.runAfterInteractions(() => {
                this.props.navigation.dispatch(resetAction);
                LayoutAnimation.linear();
            });
        }, 1500);
    };
    render() {
github kyaroru / ReactNavDrawerRedux / src / components / home / index.js View on Github external
logout() {
    const { updateCurrentUser, navigation, clearHomeData } = this.props;
    updateCurrentUser({});
    clearHomeData();
    const navigateAction = NavigationActions.reset({
      index: 0,
      actions: [
        NavigationActions.navigate({ routeName: 'LoginScreen' }),
      ],
    });
    navigation.dispatch(navigateAction);
  }
github Vinylize / Yetta-App / src / components / splash.js View on Github external
navigateToHome() {
    const resetAction = NavigationActions.reset({
      index: 0,
      actions: [
        NavigationActions.navigate({ routeName: 'Home' })
      ]
    });
    this.props.navigation.dispatch(resetAction);
  }
github wuyanwuyan / react_native_app_start_kit / src / utils / NavigationUtil.js View on Github external
const reset = (navigation, routeName, params = {}) => {
    const resetAction = NavigationActions.reset({
        index: 0,
        actions: [NavigationActions.navigate({routeName, params})]
    });
    navigation.dispatch(resetAction);
};
github Vinylize / Yetta-App / src / components / splash.js View on Github external
navigateToLoginPage() {
    const resetAction = NavigationActions.reset({
      index: 0,
      actions: [
        NavigationActions.navigate({ routeName: 'Login' })
      ]
    });
    this.props.navigation.dispatch(resetAction);
  }
github commaai / openpilot-apks / offroad / js / components / Setup / Setup.js View on Github external
navigateHome: async () => {
        ChffrPlus.writeParam(Params.KEY_HAS_COMPLETED_SETUP, "1");

        const isPassive = await checkIsPassive();
        let destRoute = 'Onboarding';
        if (isPassive) {
            destRoute = 'Home';
        }

        dispatch(NavigationActions.reset({
            index: 0,
            key: null,
            actions: [
                NavigationActions.navigate({ routeName: destRoute })
            ]
        }));
    },
    acceptTerms: async () => {