React native `戈巴克`在';不要回去

React native `戈巴克`在';不要回去,react-native,react-navigation,React Native,React Navigation,这是我的navigation.js: export const BottomTabs = createBottomTabNavigator({ 'Specials': { screen:SpecialsScreen }, 'Menus': { screen:MenusScreen }, }); export const Drawer = DrawerNavigator({ Home: { screen: Home, nav

这是我的navigation.js:

export const BottomTabs = createBottomTabNavigator({
    'Specials': {
        screen:SpecialsScreen
    },
    'Menus': {
        screen:MenusScreen
    },
});

export const Drawer = DrawerNavigator({
    Home: { screen: Home, navigationOptions: {drawerLabel:() => null} },
    Explore: { screen: BottomTabs },
    'Support & Contact': { screen: ContactScreen },
    Settings: { screen: Settings, navigationOptions: {drawerLabel:() => null} },
    TOU: { screen: TOU, navigationOptions: {drawerLabel:() => 'Terms of Use'} },
    Privacy: { screen: Privacy, navigationOptions: {drawerLabel:() => 'Privacy Policy'} },
    Disclaimer: { screen: Disclaimer },
});
因此,应用程序启动后,您将看到
主页
屏幕:

App.js
render(){
    return(<Provider store={store}><Drawer /></Provider>)
}
HomeScreen.js
<TouchableOpacity onPress={() => {
    this.props.navigation.navigate('Specials');
}}>
Specials
中,我点击汉堡图标切换抽屉,进入
Support&Contact
,其中有一个后退按钮,我想让我回到上一个屏幕:

ContactScreen.js
<TouchableOpacity onPress={() => {
    this.props.navigation.goBack();
}}>
ContactScreen.js
{
this.props.navigation.goBack();
}}>

但这会把我带到
,而不是像我想象的那样
探索
特价
。我错过了什么?

必须添加堆栈导航器

const AppStack = createStackNavigator({ App: SpecialsScreen, MenusScreen });
const HomeStack = createStackNavigator({ Home });

从Explore中,我点击汉堡包图标来切换我的抽屉,然后转到this.props.navigation.goBack();我不明白你的意图above@SirKoswara我已经重写了这个。你试过使用
goBack(null)
吗?@JoseVf刚刚试过,运气不好。