基于登录状态 React Native 的动态 DrawerNavigator [英] Dynamic DrawerNavigator based on Login State React Native

查看:84
本文介绍了基于登录状态 React Native 的动态 DrawerNavigator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个 DrawerNavigator,它可以在用户登录或注销时显示不同的选项,如下图所示:

I need a DrawerNavigator that shows different options if the user is logged in or logged out, which is illustrated below:

--------------------
| sign up / log in |
|------------------|
| info             |
--------------------

已登录

--------------------
| My Account       |
|------------------|
| Some Actions     |
|------------------|
| Info             |
|------------------|
| Log Out          |
--------------------

我设置 DrawerNavigator 没有问题,我使用了 NavigationActions 和 Redux.但是,当我尝试显示不同的 DrawerNavigation 时出现问题 - 我应该在哪里检查 Redux 的登录状态?

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?

推荐答案

我昨天遇到了同样的问题,但我找到了一个很好的示例和教程来解决这个问题.看看这个教程,祝你好运!:)

I got the same problem yesterday, but I found a good example and tutorial to do this. Look at this tutorial, good luck! :)

这篇关于基于登录状态 React Native 的动态 DrawerNavigator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆