在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)