Check out a free preview of the full React Native, v2 course
The "Adding Navigation with Expo" Lesson is part of the full, React Native, v2 course featured in this preview video. Here's what you'd learn in this lesson:
Kadi demonstrates how to add navigation while using Expo.
Transcript from the "Adding Navigation with Expo" Lesson
[00:00:00]
>> All right. So let's do the Expo one first. So I'm going to show how to add navigation to both of them. But Expo will be quite simple, it'll be quite straightforward. For pure React Native, there'll be more extra steps as always. So let's do Expo. Let's open your terminal in your project directory and you can use npm install or yarn install, and you'll want to install react navigation dash native.
[00:00:40]
And then the next thing you wanna do is you wanna install. So this installs all the native dependencies. Here's an example of where Expo has done some work for you. So we use Expo install rather than NPM install, and these are all the packages that basically are necessary in order to make navigation work.
[00:00:57]
So let's just copy this whole thing and run it. And the last thing you want to do, I've actually been using my React Native app rather than, okay, I'll just do this. Your input to navigation container. And you go to your App.js, and you add the import here.
[00:01:19]
And then you just take the navigation container and wrap your whole app in it. Cool. Yeah, so that's that's pretty much it. The reason this doesn't work for me is because I use the native application for my example. But if you refresh your app and it still works, that basically means that you've installed it correctly.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops