Introduction
Overview
React is a JavaScript library for building user interfaces. Facebook released it in 2013 to solve a specific problem: as web apps grew more interactive, keeping the page in sync with changing data became painful and bug-prone. React’s answer was a different way of thinking about UI, and it caught on so widely that today it powers Facebook, Instagram, Netflix, Airbnb, Discord, Shopify, the dashboards of countless start-ups — and much of the web’s job market.
Since 2026, React has been hosted by the React Foundation at the Linux Foundation, with an independent technical governance structure.
The problem React solves
Imagine a shopping cart without React. When a user adds an item, you have to remember to update the item list, the cart badge in the header, the total, the “free shipping” banner and the checkout button. Every feature adds more places to update by hand:
// Plain DOM code: you change the page step by step
cartBadge.textContent = items.length;
totalEl.textContent = formatPrice(total);
if (total > 50) banner.classList.remove('hidden');
list.appendChild(createItemRow(item));Miss one of those lines and the page shows something that isn’t true. This style is called imperative: you tell the browser how to change the page, one step at a time.
React’s big idea
React flips this around. You write components that describe what the UI should look like for a given state, and React works out how to change the page:
function CartBadge({ items }) {
return <span className="badge">{items.length}</span>;
}That’s declarative code. When items changes, you don’t update the badge — React re-runs the component and updates the DOM for you. This is often summarised as:
UI = f(state) — your interface is a function of your data.
Components
A React app is built from components: reusable, self-contained pieces of UI. A component is just a JavaScript function that returns markup:
function CourseCard({ title, lessons }) {
return (
<article className="card">
<h2>{title}</h2>
<p>{lessons} lessons</p>
</article>
);
}Components combine like LEGO bricks: a Page contains a Header, a CourseList and a Footer; a CourseList contains many CourseCards. Each one is small enough to understand, test and reuse.
That HTML-like syntax inside JavaScript is JSX. It looks unusual at first, but it’s just a convenient way to write JavaScript — you’ll learn exactly how it works in Writing JSX.
Where React runs
| Platform | Package | Examples |
|---|---|---|
| Web browsers | react-dom |
single-page apps, dashboards, widgets |
| Servers | react-dom/server, frameworks like Next.js |
server-rendered sites, Server Components |
| iOS and Android | React Native | Instagram, Discord, Shopify apps |
| Desktop | Electron, React Native for Windows/macOS | VS Code extensions, desktop tools |
The core react package (components, state, hooks) is the same everywhere. What changes is the renderer that turns your components into DOM nodes, native views or HTML.
Library or framework?
React itself is a library — it handles components and rendering, and leaves routing, data fetching and build tooling to you. You can use it two ways:
- With a build tool like Vite — you choose your own router and data libraries. Great for learning, single-page apps and dashboards. This is what this course uses.
- With a framework like Next.js or React Router — they add routing, server rendering and data loading on top of React. The React team recommends a framework for large production sites, and the final chapter shows how what you’ve learned carries over.
Everything you learn about components, state and hooks works identically in both.
What you need to know first
You should be comfortable with modern JavaScript: const/let, arrow functions, objects and arrays, destructuring, the spread operator, array methods like map and filter, modules (import/export), and promises with async/await. If any of those feel shaky, the JavaScript Essentials course covers them all.
You’ll also need Node.js installed (version 22 or later) — the next lesson walks you through it.
What you’ll build
Through the course you’ll build pieces of a course catalogue app — course cards, a search box, a shopping cart, forms, data loaded from an API, routes for each course page — and finish by testing and deploying it. The course targets React 19.3, including the newest features: Actions and form handling, use, useOptimistic, useEffectEvent, <Activity>, <ViewTransition> and React Compiler.
How to learn React well: type the examples yourself instead of copying them, and do every exercise. React is a way of thinking, and it only clicks once your fingers have written a few dozen components.
Summary
- React is a JavaScript library for building user interfaces out of components.
- You describe what the UI should look like for the current state; React updates the DOM to match.
- Components are plain JavaScript functions that return JSX, and they compose into a tree.
- React runs in browsers, on servers and on phones (React Native), and is maintained by the React Foundation.
- This course uses React 19.3 with Vite and builds up to a tested, deployed app.