-1

我的主要问题是登录后我想从抽屉栏中隐藏登录,而不是登录想要显示注销,

<Drawer.Navigator>    
  <Drawer.Screen name="Login" component={LoginScreen} />
  <Drawer.Screen name="OrderList">{() => (
    <Tab.Navigator initialRouteName="OrderList">
      <Tab.Screen name="OrderList" component={CompletedScreen} />
      <Tab.Screen name="Pending" component={PendingScreen} />
    </Tab.Navigator>)}
  </Drawer.Screen>
  <Drawer.Screen name="EditOrder" component={SingleOrderScreen} />
  <Drawer.Screen name="Logout" component={LogoutScreen} />
</Drawer.Navigator>
4

1 回答 1

0

这可能会有所帮助

<Drawer.Navigator>
    {isLoggedIn ? (
      <>
        <Drawer.Screen name="Logout" component={LogoutScreen} />
      </>
     ) : (
      <>
        <Drawer.Screen name="Login" component={LoginScreen} />
      </>
    )}
<Drawer.Screen name="OrderList">{() => (
    <Tab.Navigator initialRouteName="OrderList">
      <Tab.Screen name="OrderList" component={CompletedScreen} />
      <Tab.Screen name="Pending" component={PendingScreen} />
    </Tab.Navigator>)}
  </Drawer.Screen>
  <Drawer.Screen name="EditOrder" component={SingleOrderScreen} />
</Drawer.Navigator>
于 2020-10-15T11:38:21.260 回答