问题
I need a DrawerNavigator that shows different options if the user is logged in or logged out, which is illustrated below:
not logged in
--------------------
| sign up / log in |
|------------------|
| info |
--------------------
logged in
--------------------
| My Account |
|------------------|
| Some Actions |
|------------------|
| Info |
|------------------|
| Log Out |
--------------------
I have no problem setting up a DrawerNavigator, which I use NavigationActions and Redux. However problem arises when I'm trying to display different DrawerNavigation - where should I check for the login status from Redux?
回答1:
I got the same problem yesterday, but I found a good example and tutorial to do this. Look at this tutorial, good luck! :)
来源:https://stackoverflow.com/questions/48333738/dynamic-drawernavigator-based-on-login-state-react-native