从抽屉导航器导航到其他同级堆栈

时间:2019-11-29 05:51:36

标签: javascript react-native react-navigation-drawer

drawernavigator内时,我想转到stacknavigator之类的其他堆栈。当我在this.props.navigation.navigate('Auth')组件中时,我正在做的是drawernavigator。但这是行不通的。当我们切换到其他导航器时,this.props.navigation是否会更改?

请参阅我的App.js下面的导航器父结构。

const AppStack = createStackNavigator(
  {
    Home: { screen: Home, navigationOptions: { header: null } },
    Notifications: {screen:Notifications}
  });

const AuthStack = createStackNavigator(
  {
    Login: {
      screen: Login, navigationOptions: { header: null }
    }
  });

const Navigation = createSwitchNavigator(
  {
    Splash: {
      screen: Splash, navigationOptions: { header: null }
    },
    App: { screen: AppStack },
    Auth: AuthStack
  },
  {
    initialRouteName: 'Splash'
  }
);

在哪里 Home返回createAppContainer(DrawerNavigator)

0 个答案:

没有答案