Next.js adds routing, SSR, and server components to React. Files in app/ become routes automatically. Server components fetch data directly with async/await. Add 'use client' only when you need hooks or browser events.
Next.js — React Framework
npx create-next-app@latest my-app
cd my-app && npm run dev
// app/page.tsx — Server Component (default)
export default function Home() {
return Hello Next.js!
;
}
// app/users/page.tsx — Server-side data fetch
export default async function Users() {
const users = await fetch("https://api.example.com/users").then(r=>r.json());
return {users.map(u => - {u.name}
)}
;
}