Nesting Tab and Stack Navigators in React Native and Expo Apps

栏目: IT技术 · 发布时间: 5年前

Nesting Tab and Stack Navigators in React Native and Expo Apps

Photo by Luke Brugger on Unsplash

Navigation is an essential part of any mobile app that has multiple screens leading to a variety of interactions for the user. Building a working navigation system often requires us to create a structure that allows for different kinds of navigators working together.

Using react-navigation , you can definitely nest different types of navigators in a React Native app. The term nesting, when it comes to navigators, refers to rendering one navigator inside a screen of another navigator.

The need to nest navigators arises when you want a user to respond to different sections of the app. For example, an app that requires a user to enter credentials to access different features of the app—they have to go through either a login or signup screen. The home or the main screen might contain different tabs (think of Instagram), but the login and sign up screens are two separate screens that are pushed and pop one after the other.

A few of the possible scenarios for using nesting navigators include:

  • Stack navigator nested inside drawer navigator
  • Tab navigator nested inside stack navigator
  • Stack navigator nested inside a tab navigator

In this tutorial, let’s examine one of the above scenarios by nesting a tab navigator inside a stack navigator. Whether you’re following from the previous tutorial on building a stack navigator using a component-based configuration with the latest version of the react-navigation library (link below), or not, here’s the source code of the Expo demo app that’s going to be leveraged. This demo app already has a stack navigator running—you can download the source code from the GitHub repo here .

You can read the complete post on setting up a Stack Navigator using react-navigation version 5 here:


以上所述就是小编给大家介绍的《Nesting Tab and Stack Navigators in React Native and Expo Apps》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

他们以为自己很厉害:12个企业管理陷阱

他们以为自己很厉害:12个企业管理陷阱

[法] 克里斯蒂娜•凯德朗 / 王倩 / 人民邮电出版社 / 2018-11 / 69.00元

本书讲述了震惊世界的150个企业管理失败案例,并从产品与服务定位、技术 创新、广告与营销策略、跨文化发展、融资战略到企业文化与员工管理等众多角度, 揭露了商场各种败局的内幕。作者以风趣的笔触讲述了国际知名企业和商界精英们 的惨痛教训,又以专业角度解读了这些失利背后的经济学和管理学因素,给读者带 来了启示。一起来看看 《他们以为自己很厉害:12个企业管理陷阱》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具