Lesson 1.1 — What Next.js adds to React
ReadStep 1 of 4
React is a library, Next.js is a framework
In the React course you built components. React draws the screen, but it leaves other jobs to you: giving each page its own URL, loading data, and preparing the app for real visitors.
Next.js is a framework built on React. A framework is a set of tools and rules that already answers those questions. You write components and follow its file layout.
- Routing. Each folder you create becomes a URL.
- Server rendering. The server builds the HTML before it sends the page.
- Data fetching. A component can load its data on the server.
- Build. One command prepares a production version of the app.
app/page.tsx
Tab indents. Press Escape, then Tab, to leave the editor. Control or Command plus Enter runs the code.
This code needs a server, so it is not run here. Check looks for the right pieces. Try it for real in your own project.