Basics

What is React — and why you stop touching the page by hand

Illustration: the data changes — and the interface rebuilds itself

Here's the thing: the real trick of React isn't the one everyone repeats. People say "components, components." But the actual idea is this: you stop reaching into the page by hand to change things. You just change the data — and React figures out what to redraw. Sounds small, but it flips the entire way you build interfaces. Let me show you the pain it spares you.

What it is in one line

React is a library for building interfaces out of pieces, where you describe how the screen should look for given data, not how to change it by hand. The first is called "declarative," the second "imperative." That's the whole difference.

It's not a language or an all-in-one framework. It's a tool for exactly one thing: drawing what the user sees.

The pain React cures

Picture a page without React. You have a likes counter. To add a like you write something like: "find the element with the number, read it, add one, write it back, and don't forget to highlight the button." Every change is a manual command: find → change. Those commands poke at the DOM — the live tree of the page the browser builds.

With one button it's bearable. But a real app has hundreds of these links: one thing changes, and you must manually update five places. Forget one → the screen is out of sync. That's how bugs you can never catch are born.

React says: don't touch the page yourself. Describe once how the counter looks for a number N. After that, just change N — React finds what to redraw.

A component = a function that returns a piece of interface

This is where components come in. A component is a function that takes data and returns a piece of interface. A button, a card, a whole page — all components. You nest them like blocks: a page is made of cards, a card of buttons and text.

The beauty: you write a component once and use it a hundred times. Build a product card, and the whole catalog is assembled from it, just with different data. No copy-paste.

Change the state — the screen redraws itself

The "data the look depends on" is called state in React. That's our counter N. The trick: you change state in one line — and React compares before and after, and changes on screen only what's actually different.

To avoid hammering the real page a hundred times (that's slow), React keeps a light copy of it — the "virtual DOM" — compares versions there, and touches the real page minimally. You don't think about this: you change the data, the rest is React's job. This "data → look" wiring is the whole reason React exists.

When you need React, and when you don't

React isn't the answer to everything. If you're building a landing page or a two-page blog with no live data — it's overkill; plain HTML is enough, and the site is lighter and faster. React starts paying off when the interface changes in response to actions: feeds, dashboards, chats, carts — anywhere "one thing changed, many must update." In vibe coding you feel it fast: the more interactive the idea, the sooner React shows up. If you're still figuring out what to build, see what vibe coding is — React is almost always nearby.

Is React a programming language?

No. React is a JavaScript library. On its own it does nothing: you write JavaScript (often with JSX — HTML right inside the code), and React helps turn it into a live interface.

How is React different from Next.js?

Next.js is a layer on top of React: it adds routing (multiple pages), server rendering, and lots of conveniences for a real site. React is the "interface engine," Next.js is the "finished car" built around it. For a beginner it's easier to start with Next.js than to wire everything by hand.

Do I have to learn React to vibe code?

By heart, no. But React (or Next.js on top of it) will almost certainly be under the hood of the app you build with AI. Understand the "data → look" idea, and you stop being scared of the code it generates for you.

Learn vibe coding — don’t just read about it

Short story-lessons, an agent simulator and daily practice — in our mobile app. Free.

Open the app
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →