初始路径名称在我的DrawerNavigator中不起作用

问题描述 投票:0回答:1

下面是我的DrawerNavigator

export const Drawer = DrawerNavigator({
    Home: { screen: AppStack, navigationOptions: {drawerLabel:() => null} },
    Permissions: { screen: AppStack, navigationOptions: {drawerLabel:() => null} },
    Explore: { screen: AppStack, navigationOptions: {drawerLabel:() => 'Explore'} },
    ContactScreen: { screen: AppStack, navigationOptions: {drawerLabel:() => 'Contact & Support'} },
    TOU: { screen: AppStack, navigationOptions: {drawerLabel:() => 'Terms of Use'} },
    Privacy: { screen: AppStack, navigationOptions: {drawerLabel:() => 'Privacy Policy'} },
    Disclaimer: { screen: AppStack },
    Settings: { screen: AppStack, navigationOptions: {drawerLabel:() => null} },
},{
    initialRouteName:'Privacy'
});

当从App.js调用<Drawer />时,它会路由到Home而不是Privacy,因为我的initialRouteName应该这样做。有谁知道为什么?

react-native react-navigation
1个回答
0
投票

您已将AppStack列为每条路线的屏幕名称。我想你的AppStack是用StackNavigator({...})创建的,而initialRouteName是Home

© www.soinside.com 2019 - 2024. All rights reserved.