下面是我的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
应该这样做。有人知道为什么吗?
答案 0 :(得分:0)
您已列出$fullname
作为每条路线的屏幕名称。我想象您的AppStack是使用StackNavigator({...})创建的,而initialRouteName是AppStack
。