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

时间:2018-09-07 20:17:23

标签: react-native react-navigation

下面是我的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应该这样做。有人知道为什么吗?

1 个答案:

答案 0 :(得分:0)

您已列出$fullname作为每条路线的屏幕名称。我想象您的AppStack是使用StackNavigator({...})创建的,而initialRouteName是AppStack