Исходное имя маршрута не работает в моем DrawerNavigator - PullRequest
0 голосов
/ 07 сентября 2018

Ниже мой 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 голосов
/ 08 сентября 2018

Вы указали AppStack в качестве отображаемого имени для каждого маршрута. Я полагаю, ваш AppStack создается с помощью StackNavigator ({...}), а initialRouteName - Home.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...