This video is available to students only

Creating a stack navigator

Creating a stack navigator

In this lesson we are going to actually use the react-navigation library in our app.

We start by wrapping our application in a <NavigationContainer/> which is responsible for managing app state and linking a top-level navigator to the app. This component is necessary since it will be treated as a root of navigation in our app. It will also take care of actions like pressing the back button and notifying of state changes for screen tracking.

In our application we will use the most common navigator: Stack Navigator. This is exactly what it sounds like — a stack. It provides exactly what it sounds like — a stack of navigation.

We create a Stack using the following code:

The @react-navigation/stack dependency is missing in our app, we have to install it by running this command.


This page is a preview of Creating a React Native Login

Start a new discussion. All notification go to the author.