What is Next.js?
Next.js is a full-stack React framework by Vercel. It adds file-system routing, server rendering and static generation, React Server Components, data caching, Route Handlers for APIs, Server Functions for mutations, and image, font and script optimization on top of React. Version 16 (latest 16.4, October 2026) uses Turbopack by default and the Cache Components model with "use cache".
Main features
- App Router: folders in
app/are routes, with nestedlayout.tsx,loading.tsxanderror.tsx. - Server Components by default; add
"use client"for interactive components. - Partial Prerendering: a static shell served instantly from a CDN, with dynamic parts streamed in.
- Caching:
"use cache",cacheLife,cacheTag,revalidateTag,updateTag. - Server Functions (
"use server") for forms and mutations. - Route Handlers (
route.ts) for HTTP APIs and webhooks. - Proxy (
proxy.ts, formerly middleware) for redirects and rewrites before routing. - Optimizations:
next/image,next/font,next/script, Metadata API. - Tooling: Turbopack, TypeScript, React Compiler support.
Getting started
npx create-next-app@latest, then npm run dev.
Relationship to React
The React docs list Next.js (App Router) as a recommended framework because it implements React's full-stack architecture (Server Components, Actions, Suspense streaming). Vercel is a founding member of the React Foundation.
Alternatives
React Router framework mode, TanStack Start, Expo for native apps, or a Vite SPA when you do not need a server.
Code example
1// app/page.tsx - a Server Component (default in the App Router)2import { LikeButton } from "./like-button";34async function getPosts() {5 "use cache"; // Next.js 16 Cache Components6 const res = await fetch("https://api.example.com/posts");7 return res.json() as Promise<{ id: string; title: string }[]>;8}910export default async function Home() {11 const posts = await getPosts(); // runs on the server, no client JavaScript for this code12 return (13 <main>14 {posts.map((p) => (15 <article key={p.id}>16 <h2>{p.title}</h2>17 <LikeButton id={p.id} />18 </article>19 ))}20 </main>21 );22}2324// app/like-button.tsx25// "use client";26// export function LikeButton({ id }: { id: string }) {27// const [liked, setLiked] = useState(false);28// return <button onClick={() => setLiked(!liked)}>{liked ? "♥" : "♡"}</button>;29// }
Practice this question
Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the React set.