Dynamic DrawerNavigator based on Login State React Native

筅森魡賤 提交于 2021-02-07 07:56:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!