Skip to main content

Routing for Next.jss

Routing in Next.js App Router means the folders inside the app directory define URLs. A page.js file makes a folder reachable, layout.js wraps child routes, and square brackets mark dynamic segments. It sits at the base of the framework, and Link and useRouter move users between pages.

Stage: App Router Basics · Part of the Next.js roadmap · Last reviewed 19 November 2026

What to learn in Routing

Routing interview questions

How does the Next.js App Router map folders to URLs?

Each folder under app becomes a URL segment, and it becomes publicly reachable only when it holds a page.js file. Folders in square brackets are dynamic, parentheses create route groups that do not affect the URL, and layout.js wraps everything below it.

What is the difference between Link and useRouter in Next.js?

Link is a component that renders an anchor and prefetches the target route when it is visible, so it suits normal navigation. useRouter is a client-side hook for programmatic moves such as push or replace after a form submit or a timer.

Where Routing fits in the Next.js roadmap

Routing belongs to the App Router Basics stage (beginner level), which takes about 16 hours. Files become routes.

Back to the full Next.js roadmap