From the course: React Essential Training
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Using the App Router - React.js Tutorial
From the course: React Essential Training
Using the App Router
- [Instructor] As I mentioned in the previous video, we're using Next.js, and specifically, we're using the App Router. What this means is that within my project, my Next.js project, we have a folder called app that's going to create all of the different routes that are part of our application. So, this is a file-based routing structure that we can use so that anytime I create a folder, like mountain, this is going to create a new route for me. Within that mountain folder, I can create a new file called page.js, and the page.js file is going to display whatever content we want to see when I hit this route. So, for example, I can create a new function called Page, and then here we can return a main component. Inside the main component, we'll add an h1, Lift Status Info. So, within the next React project, we're going to run npm run dev, go to localhost:3000, and we see our homepage here, but we're here really to look for mountain, right? And this is going to show our Lift Status Info…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.