BitlystBitlyst
PostsSeriesTopicsAbout

Bitlyst

Short, diagram-first posts on JavaScript, React & Next.js. Follow via RSS or the newsletter.

© 2026 Mohsen Fallahnejad

PostsSeriesTopicsLinksAboutRSSGitHubX
Posts/nextjs
Beginner2 min read

Next.js Page Router vs App Router

Understand the key differences between the old Page Router and the new App Router in Next.js.

Mohsen Fallahnejad

Mohsen Fallahnejad

Sep 23, 2025Discuss

Next.js gives us two ways of building apps: the older Page Router (/pages) and the newer App Router (/app).
Here’s the difference explained simply:


The Simple Idea#

  • Page Router (old way):
    You put files inside /pages. Each file = one route. It’s simple, but limited when your app grows.
  • App Router (new way):
    You put files inside /app. It uses React Server Components, layouts, and modern features. It’s more powerful, but needs a bit more learning.

Analogy 🪟#

Think of it like building a house:

  • Page Router = separate rooms. Each room (page) has its own door. If you want a shared wall (like a layout), you must rebuild it in every room.
  • App Router = house with shared walls. Rooms (pages) can share layouts, data fetching, and logic without repeating work.

Key Differences 🔑#

  • File location: /pages vs /app
  • Rendering: Page Router = fully client-side components; App Router = supports Server Components
  • Layouts: Page Router = no built-in layouts; App Router = nested layouts by default
  • Data fetching: Page Router = getServerSideProps / getStaticProps; App Router = async functions inside components (simpler & more flexible)
  • Best for:
    • Page Router → quick prototypes, small apps
    • App Router → modern apps, scalable projects, production-ready

Code Example#

Page Router

tsx
// pages/about.tsx
export default function About() {
  return <h1>About Page</h1>;
}

App Router

tsx
// app/about/page.tsx
export default function About() {
  return <h1>About Page</h1>;
}

When to Use?#

  • ✅ New project → App Router (future of Next.js)
  • ✅ Old project already using /pages → stay with Page Router unless you want to migrate
  • ❌ Don’t mix them in the same route (but you can run both in one project during migration)

That’s it! 🎉

Filed under#nextjs#react#routing#frontend

Was this worth your time?

One tap tells me what to write more of.

Mohsen Fallahnejad

Written by

Mohsen Fallahnejad

Frontend engineer explaining JavaScript, React & Next.js internals in posts you can finish over coffee. More about me

X ↗GitHub ↗LinkedIn ↗
← OlderJavaScript Event Bus 🚍 (JS + TypeScript)Newer →What is 'use client' in Next.js?

Start the discussion

Questions, corrections, a better approach? I read and reply to every comment.

Read next

What is 'use client' in Next.js?

Understand 'use client' in Next.js App Router: what it means, when to use it, and how it works under the hood.

Sep 23, 20252 min read

MVVM, Micro‑Frontends, and Domain‑Driven Frontend — A Practical Guide

Clear, practical explanations of MVVM, micro‑frontends, and domain‑driven design for modern React/Next.js teams, with examples, folder structures, and trade‑offs.

Sep 15, 20256 min read

The Server Action That Ran Twice, but Only on localhost

Why a Next.js Server Action called from useEffect runs twice in development: React Strict Mode mounts every component twice. What that reveals, and where the call belongs.

Nov 3, 20264 min read

Get new posts in your inbox

No spam. Unsubscribe any time.

2 min left
Discuss👍 React
👍