如何在反应导航(v1)中从一个选项卡的堆栈导航器跳到该选项卡的父导航器的屏幕

时间:2018-08-10 12:28:36

标签: react-navigation

MainNavigator

const MainNavigator = StackNavigator(
  {
    Start:{ screen:Start },
    Login:{ screen:Login },
    mainFlow:{
      screen: TabNavigator({
        Profile: { screen: Profile },
        List: { screen: List },
        MenuStack: { screen: StackNavigator({
          Menu: {screen: Menu},
          OpenChannel: { screen: OpenChannel },
          OpenChannelCreate: { screen: OpenChannelCreate },
          Chat: { screen: Chat },
          Member: { screen: Member },
          BlockUser: { screen: BlockUser },
          GroupChannel: { screen: GroupChannel },
          GroupChannelInvite: { screen: GroupChannelInvite },
        },{
          initialRouteName: 'Menu',
          headerMode: 'none',
        })}
      },{
        initialRouteName: 'Profile'
      })
    }
  },{
    initialRouteName: 'Start',
  }
);

如何从mainFlow的menuStack的菜单跳转到MainNavigator的登录屏幕。 我尝试了一些方法,例如将父级导航传递给作为参数的子级导航,但是我未能将导航从tabNavigation传递给子项StackNavigation ... 我真的需要你的帮助!

0 个答案:

没有答案