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.
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.
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 each problem a plain React SPA has to the Next.js feature that handles it.
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 servernext 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.
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.
2013
React is open-sourced
A UI library only. Routing, data and servers are left to you.
2016
Next.js 1.0
File-based routing in `pages/` and server rendering by default.
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.
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.
2023
App Router stable, Server Actions
13.4 marks the App Router stable. 14 makes Server Actions stable: call server functions straight from forms.
2024
Next.js 15
React 19 support. `params`, `searchParams`, `cookies()` and `headers()` become Promises. `fetch` stops being cached by default.
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 these Next.js milestones in order, oldest first.
- Tap the steps below in the right order.
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.
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.
| Option | What it is | Pick it when |
|---|---|---|
| Vite + React (SPA) | Client-rendered app, static files only | Internal 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 rendering | You like web-standard loaders and actions and want to stay close to the Request/Response model |
| Astro | Content-first, ships zero JS by default, "islands" of React | Blogs, docs and marketing sites with little interactivity |
| TanStack Start | Full-stack framework on TanStack Router and Vite | You want type-safe routing everywhere and a lighter, more explicit server model |
| Next.js | Full-stack React with RSC, caching and many deploy targets | Mixed 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.
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.
- 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 withgetStaticPropsandgetServerSideProps. Still supported, not used for new work. - Turbopack
- The Rust-based bundler that is the default for
next devandnext buildin Next.js 16.