What is React
A JavaScript library for building user interfaces out of reusable components - what React actually is, why it exists, and how it fits with plain JavaScript.
What it is, in plain English: React is a JavaScript library (not a framework) for building user interfaces. Its core idea: describe what the UI should look like for any given state, and React figures out the minimal DOM changes needed to make that true. You build interfaces by composing small, reusable pieces called components. React was created by Facebook (now Meta) in 2013 and is maintained by Meta alongside a large open-source community.
A different way to think about building UIs
Without React, building an interactive page means manually finding DOM elements and updating them every time something changes — easy to forget a spot, easy to create bugs where the screen doesn't match the actual data.
React flips this: you write a function that describes what the UI should look like for the current data. Whenever that data changes, you call the function again, and React automatically figures out the minimum changes needed to update the real page.
The simplest React component
function Welcome() {
return <h1>Hello, World!</h1>;
}
// This looks like HTML inside JavaScript — that's JSX (covered in the next page).
// A "component" is just a JavaScript function that returns what should appear on screen.Why React exists
// The problem React solves: keeping the UI in sync with data, as an app grows.
// Small apps: manual DOM updates are manageable.
// Real apps: dozens of pieces of data, all affecting different parts of the screen.
// Manually tracking "when X changes, update Y, Z, and W" becomes unmanageable.
// React's answer: don't track individual updates.
// Just describe the WHOLE UI based on the CURRENT data, every time.
// React's diffing algorithm only touches what actually changed.Components — the core building block
// A React app is a tree of components, each one a small, focused piece of UI:
function App() {
return (
<div>
<Header />
<ProductList />
<Footer />
</div>
);
}
function Header() {
return <header><h1>My Store</h1></header>;
}
// Each component manages its own piece of the UI.
// Components can be reused anywhere — write once, use everywhere.What React is NOT
// React is a LIBRARY, not a full framework.
// Out of the box, React only handles UI rendering.
// You add separate libraries for:
// - Routing → React Router, or built into Next.js
// - Data fetching → fetch/axios + TanStack Query, or built into Next.js
// - State (global) → Context API, Zustand, Redux
// - Styling → CSS, Tailwind, styled-components
// "Frameworks" like Next.js bundle React + routing + data fetching + more
// into one opinionated package. React itself stays small and focused.
Try It Yourself (JSX)
Official Sources
- React Documentation — Learn React
- React Documentation — Describing the UI
- react.dev — Render and Commit
The Codex links only to official documentation. No third-party tutorials.