

Nesting Tab and Stack Navigators in React Native and Expo Apps
source link: https://heartbeat.fritz.ai/nesting-tab-and-stack-navigators-in-react-native-and-expo-apps-cc118a141e70?gi=4d3dbc044af7
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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:
Recommend
-
11
Multi Screen Starter with Expo react native / expo / react navigation v4.
-
17
Uber: UI Clone with Expo Uber UI Clone with React Native & Expo. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or ya...
-
33
Neumorphism with Expo Neumorphism with expo and react native. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or yarn inst...
-
15
movie-react-native-app Ejemplo de react native movie app, basado en The movie Database API y Expo cli. ...
-
8
react-native-mask-text This is a library to mask Text and Input components in React Native and Expo (Android, iOS and Web). Install yarn add react-native-mask-text Shell...
-
14
Slack Clone with Expo Slack UI Clone with React Native & Expo. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or yarn...
-
7
Musicont React Native & Expo music player application UI. Installation First, make sure you have Expo CLI installed: npm install -g expo-cli Clone: git clone ht...
-
9
⚛️React Native Navigations This project was created with React Native CLI and TypeScript template. Description This project is a new...
-
17
Expo Instagram Reels It provides a component that allows you to display a list of reels similar to the Instagram app. Features List of videos Seekable videos Play/Pause option Fully cus...
-
11
Meet the Navigators: DigitalOcean’s inaugural class of 2021
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK