Learn/Next.js/Chapter 3

Chapter 3 of 21

Continue learning Next.js step by step.

14%
Chapter 3

App Router

Understand the App Router and the app directory in Next.js.

Theory

The App Router is the modern routing system in Next.js. It uses the app directory to organize pages, layouts and routes. Special files such as page.tsx and layout.tsx are used to define application UI and shared layouts.

Example

app/
├── page.tsx
├── layout.tsx
└── about/
    └── page.tsx

Output

The file structure creates a home page and an /about route.

Practice

Create an app directory with a home page and an About page.

Interview Questions

1

What is the App Router?

2

What is page.tsx?

3

What is layout.tsx?

Quick Quiz

Which option best describes this chapter?

A.Modern Next.js routing system
B.Database system
C.CSS framework
D.Package manager