Chapter 1 of 11
Next.js is a framework built on top of React and JavaScript. Think of it like this: JavaScript is raw ingredients, React is a cooking technique, and Next.js is a fully-equipped professional kitchen that gives you the tools, structure, and workflow to build real applications efficiently.
ANALOGY
Real-world analogy: Building a house. You could build a house from raw materials — bricks, cement, timber. But most builders use prefabricated components — pre-made walls, standard frames, standard plumbing fittings. Next.js is like those prefabricated components for web apps. You still design and build the house — but you're not starting from absolute zero every time.
Next.js is built on React. React is a JavaScript library for building user interfaces using reusable components. A component is just a function that returns HTML-like code. Everything in a React/Next.js app is made of components.
// A component is just a function that returns "JSX" (HTML-like syntax)
function WelcomeBanner({ name }) {
return (
<div>
<h1>Welcome back, {name}!</h1>
<p>Ready to keep learning?</p>
</div>
);
}
// You use components like custom HTML tags:
// <WelcomeBanner name="Nelson" />
// <WelcomeBanner name="Alice" />
// Each one renders independently with its own dataNOTE
What is JSX?. JSX is the HTML-like syntax you see inside JavaScript files. It's not real HTML — it's a syntax extension that gets compiled to JavaScript. The key difference: use className instead of class, use {} for JavaScript expressions inside the markup, and all tags must be properly closed.