Skip to content

Lesson 1 of 27Foundations

What Is Next.js

Know what problems Next.js solves on top of React, where it came from, and when to pick something else.

11 min read0/4 questions

The React course left you able to build components, manage state and fetch data in the browser. This track builds on all of it and does not re-teach it. React draws UI. It does not decide how URLs map to screens, where data comes from, how code gets bundled, or what a search engine sees when it loads your page. Next.js is the most common answer to all of those at once, and a large share of React job postings now list it by name. Knowing why it exists makes every later lesson in this track easier to reason about.

What React alone leaves you to solve

Picture a plain React app built with Vite. The server sends an almost empty HTML file and a JavaScript bundle. The browser downloads the bundle, runs it, React renders, then your useEffect fetches data, then the real content appears. This is client-side rendering (CSR): all the rendering work happens in the browser.

Here is that waterfall as code. Run it and watch the order of events.

TypeScriptspa-timeline.ts
const wait = (ms: number) => new Promise((r) => setTimeout(r, ms));const start = Date.now();const log = (msg: string) => console.log(`${String(Date.now() - start).padStart(4)}ms ${msg}`); log("HTML arrives: <div id=\"root\"></div> (nothing to read yet)");await wait(300);log("JS bundle downloaded and parsed");await wait(50);log("React renders a loading spinner");await wait(250);log("useEffect fetch returns: product data");log("Real content visible");
Output
Press Run (⌘ Enter) to see what happens.

Every step waits on the one before. On a slow phone that can be several seconds of blank screen, and a crawler that does not run JavaScript sees an empty div. Teams used to bolt on their own fixes: a router library, a Node server that renders React to HTML, a webpack config, a way to share data between server and client. Next.js packages those decisions into one framework.

Match the pairs0/5 matched

Match each problem a plain React SPA has to the Next.js feature that handles it.

Choose an item, then its match on the other side.

So what is Next.js, exactly?

Next.js is a React framework: you write React components, and Next.js provides the routing, rendering, data fetching, bundling and server around them. A few terms you will see all through this track:

  • Server rendering: running your React components on a server to produce HTML, so the browser gets real content in the first response.
  • Prerendering: doing that server rendering ahead of time, at build time, so the HTML can be served from a CDN (a network of servers close to users).
  • Hydration: the browser downloads the JavaScript for interactive components and attaches event handlers to the HTML the server already sent.
  • React Server Components (RSC): components that only ever run on the server. Their code is never shipped to the browser. Next.js uses them by default.

The day-to-day workflow is three commands:

npx create-next-app@latest my-app   # TypeScript, Tailwind, ESLint, App Router, Turbopacknpm run dev                          # next dev: local server with fast refreshnpm run build && npm run start       # next build, then next start: the production server

next build compiles and prerenders everything it can. next start runs a Node.js server (Node 20.9 or newer) that serves prerendered pages instantly and renders the rest on demand. In Next.js 16, Turbopack, a bundler written in Rust, is the default for both dev and build.

Quick check
A page in Next.js is a Server Component that reads from a database and renders a list. What does the browser download for it?
Need a nudge? A hint rules out a wrong answer.

A short history

Next.js was released in October 2016 by ZEIT, the company now called Vercel. The pitch was small: put a React component in pages/about.js and you get a server-rendered /about page. No router config, no webpack config.

How Next.js got here
  1. 2013

    React is open-sourced

    A UI library only. Routing, data and servers are left to you.

  2. 2016

    Next.js 1.0

    File-based routing in `pages/` and server rendering by default.

  3. 2020

    Static generation and ISR

    `getStaticProps` and `getServerSideProps` let each page choose build-time or request-time rendering. Incremental Static Regeneration refreshes static pages in the background. ZEIT renames itself Vercel.

  4. 2022

    Next.js 13 and the App Router

    A new `app/` directory built on React Server Components, nested layouts and streaming. Turbopack appears in alpha.

  5. 2023

    App Router stable, Server Actions

    13.4 marks the App Router stable. 14 makes Server Actions stable: call server functions straight from forms.

  6. 2024

    Next.js 15

    React 19 support. `params`, `searchParams`, `cookies()` and `headers()` become Promises. `fetch` stops being cached by default.

  7. 2025

    Next.js 16

    Turbopack becomes the default bundler. Cache Components and the `use cache` directive. `middleware.ts` is renamed `proxy.ts`.

The big turn was 2022. The original Pages Router (pages/ folder, getServerSideProps, getStaticProps) made you pick a rendering mode per page and pass data down as props. The App Router (app/ folder) lets every component fetch its own data on the server, nest layouts, and stream parts of a page as they become ready. You will still meet Pages Router code in older projects and tutorials, but new work uses the App Router, and this track teaches only that.

Put it in order5 steps

Put these Next.js milestones in order, oldest first.

  1. Tap the steps below in the right order.
Need a nudge? A hint shows where it starts.

What it looks like from the inside

Here is the client side of the story you will build in later lessons. A Server Component fetches data and passes it to a small interactive Client Component. Only the interactive part ships JavaScript. The live preview below is that client component on its own.

Reactlike-button.tsx
import { useState } from "react"; // In Next.js this file starts with "use client".// The page (a Server Component) would pass `initialLikes` from the database.function LikeButton({ initialLikes }: { initialLikes: number }) { const [likes, setLikes] = useState(initialLikes); return ( <button onClick={() => setLikes(likes + 1)} style={{ padding: "8px 14px" }}> Like ({likes}) </button> );} export default function App() { return ( <article style={{ fontFamily: "system-ui" }}> <h2>Shipping a Next.js app</h2> <p>This text came from the server as HTML. No JavaScript needed to show it.</p> <LikeButton initialLikes={41} /> </article> );}

That split (server for data and markup, client only for interactivity) is the core idea of modern Next.js.

When to pick something else

Next.js is a strong default for content sites, e-commerce, SaaS dashboards and anything that needs SEO plus interactivity. It is not the only option.

OptionWhat it isPick it when
Vite + React (SPA)Client-rendered app, static files onlyInternal tools behind a login, no SEO needs, you want the simplest hosting
React Router (framework mode)The Remix team's ideas merged into React Router v7: loaders, actions, server renderingYou like web-standard loaders and actions and want to stay close to the Request/Response model
AstroContent-first, ships zero JS by default, "islands" of ReactBlogs, docs and marketing sites with little interactivity
TanStack StartFull-stack framework on TanStack Router and ViteYou want type-safe routing everywhere and a lighter, more explicit server model
Next.jsFull-stack React with RSC, caching and many deploy targetsMixed static and dynamic pages, SEO, a large ecosystem and hiring pool

Create React App, the old default for starting a React project, was officially deprecated in 2025. The React docs now point new projects at a framework.

Quick check
Your team is building an internal admin panel. Everything sits behind a login, nothing needs to be indexed by Google, and you want to host it as static files on S3. Which choice is the most reasonable?
Need a nudge? A hint rules out a wrong answer.

How this course is laid out

  • Foundations: rendering strategies, Server and Client Components, routing and layouts.
  • Routing in depth: dynamic routes, URL state, parallel routes, streaming and error handling.
  • Full-stack: data fetching and caching, Server Actions, Route Handlers, databases, metadata, i18n, auth, and reading older Pages Router code.
  • Shipping: a project structure that scales and deploying to Vercel or your own servers.
  • Production Next.js: security, testing, performance and observability.

By the end you will be able to build a full-stack Next.js app, ship it and keep it healthy in production. The course closes with a wrap-up that ties it all together.

Key terms
React framework
A layer on top of React that decides routing, rendering, data fetching, bundling and serving. Next.js is the most widely used one.
client-side rendering (CSR)
The server sends a nearly empty HTML page; the browser downloads JavaScript and React builds the UI there.
server rendering
Running React components on a server to produce HTML, so the first response already contains content.
App Router
The app/ directory routing system (Next.js 13+), built on React Server Components, nested layouts and streaming.
Pages Router
The original pages/ directory system with getStaticProps and getServerSideProps. Still supported, not used for new work.
Turbopack
The Rust-based bundler that is the default for next dev and next build in Next.js 16.