The library that redefined how the web is built. Components + one-way data flow + a virtual DOM — React powers the UIs of Facebook, Instagram, Netflix, and a generation of SPAs.
← Back to Client SideuseState; React re-renders when it changes.useState, useEffect, useMemo that add behavior to components.import { useState, useEffect } from "react"; function ProductList() { const [products, setProducts] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { fetch("/api/products") .then(r => r.json()) .then(data => { setProducts(data); setLoading(false); }); }, []); if (loading) return <p>Loading…</p>; return ( <ul> {products.map(p => ( <li key={p.id}>{p.name} — ${p.price}</li> ))} </ul> ); }
useState — local component state.useEffect — side effects (fetching, subscriptions, DOM).useMemo / useCallback — memoize expensive values / functions.useContext — read shared state without prop-drilling.useRef — mutable values & DOM refs.JSX compiles to React.createElement calls, producing a tree of plain objects. React's fiber reconciler diffs the tree against the previous render and applies the minimal DOM changes — fast, predictable updates.
React Server Components (RSC) render on the server with zero JS shipped to the client — perfect for data-heavy pages. React 19 adds use(), the new Actions model, and useFormStatus / useOptimistic for form-driven UIs. Best experienced via Next.js.
| Library | When to use |
|---|---|
| React Context | Small, infrequent shared state. |
| Zustand | Lightweight global store, minimal boilerplate. |
| Redux Toolkit | Large apps with strict patterns & devtools. |
| Jotai / Recoil | Atomic, fine-grained reactivity. |
| TanStack Query / SWR | Server-state caching & revalidation. |
Dashboards, admin tools, design tools — Figma, Notion, Linear.
SSR, SSG, server components — the dominant React stack today.
React Native shares skills & code with web teams.
Reusable design systems shared across products.