Frameworks
Components, hooks and rendering, then the ecosystem: routing, data, styling, testing and forms.
Learn React the modern way — function components, hooks and how rendering really works — then choose your tools for routing, state, server data, styling, forms, validation, testing and animation. Optional subjects are alternatives to the recommended pick.
The subjects follow the roadmap.sh React roadmap.
Every React app starts from a toolchain that compiles JSX, bundles modules and serves a fast dev server. Create React App is retired; start with a framework, or with Vite when you want a plain client-side app.
A dev server with native ES modules and instant hot reload, and a Rollup-based production build. npm create vite@latest with the React template is the quickest start.
A React app is a tree of components: functions that take props and return UI. Learn JSX, the difference between props and state, rendering conditionally, and composing small components into bigger ones instead of building one giant one.
A component is a function whose name starts with a capital letter and that returns JSX. Keep it pure: same props and state in, same UI out.
HTML-like syntax that compiles to function calls. One root element (or a fragment), className instead of class, and any JavaScript expression inside { }.
Props are inputs a parent passes down and the component must not change; state is the component's own memory that changes over time and triggers a re-render.
Return different JSX with if, the ternary operator or && — and watch out for {count && …} rendering a literal 0.
Build complex UI by nesting components and passing JSX as children or other props, rather than through inheritance or huge configuration objects.
React renders by calling your components, comparing the result with the previous tree, and committing only the differences to the DOM. Knowing when components re-render, how keys preserve identity, and where effects fit into the lifecycle explains most performance and state bugs.
A component mounts, updates when its props or state change, and unmounts. With hooks you think in effects that synchronise with something external rather than lifecycle methods.
Render arrays with map, giving each item a stable, unique key from your data. Index keys break state when items are reordered or removed.
Passing a function that returns JSX so a component can share behaviour while the caller decides what to render. Mostly replaced by custom hooks, still useful for headless components.
useRef holds a value that survives renders without causing one, and gives you the underlying DOM node for focus, measuring or third-party libraries. In React 19 ref is a normal prop.
Handlers like onClick receive a synthetic event; pass a function, do not call it. Events bubble up the React tree — stopPropagation and preventDefault work as you expect.
A function that takes a component and returns an enhanced one — the pre-hooks way to share logic. You will meet HOCs in older libraries; write hooks instead.
Hooks give function components state, effects, context and refs. Call them at the top level of components and custom hooks only — never in loops or conditions — and reach for an effect only when you are synchronising with something outside React.
Adds a state variable. Updates are batched and applied on the next render; use the updater form setCount(c => c + 1) when the new value depends on the old one.
Runs after commit to sync with external systems — subscriptions, timers, non-React widgets — with a cleanup and a dependency array. Deriving data or responding to events does not need one.
Reads a value provided higher up the tree without passing props through every level. Every consumer re-renders when the value changes.
A mutable { current } box that persists across renders — for DOM nodes, timer ids and previous values. Changing it does not re-render.
Caches an expensive calculation between renders. Profile before adding it — and with the React Compiler, most manual memoisation becomes unnecessary.
Caches a function so a memoised child or an effect dependency sees the same reference between renders.
State updated by dispatching actions to a reducer — clearer than several useStates when updates are related or complex.
Extract stateful logic into a useSomething function that calls other hooks. Each component using it gets its own independent state.
Follow the rules of hooks (and the ESLint plugin), keep dependency arrays honest, derive values instead of syncing state, and lift or colocate state deliberately.
A router maps URLs to components, keeps the address bar in sync with the UI, and handles nested layouts, params and data loading. Frameworks bring their own; in a plain app pick one of these.
The long-standing standard: nested routes, layouts, loaders and actions. Use it as a library in a Vite app, or in framework mode.
Fully type-safe routing — typed params and search params, built-in data loading and caching.
Do not hand-build every date picker. Component libraries give you accessible, tested building blocks; choose between ones you install as a dependency and ones you copy into your codebase and own.
Not a package: a CLI copies Radix- or Base UI-based, Tailwind-styled components into your project, so you own and edit the code.
A large, mature library implementing Google's Material Design, with a theming system and data-heavy components.
Accessible, themeable components styled through props and design tokens.
React does not prescribe styling. Utility classes, scoped CSS files and build-time CSS-in-JS all work; avoid runtime CSS-in-JS in new apps, as it conflicts with server components and streaming.
Utility classes in your markup, compiled to only the CSS you use, with design tokens defined in CSS. The most common choice for new React projects.
Plain CSS files whose class names are scoped to the component that imports them — no naming collisions, no new syntax.
CSS-in-JS syntax with zero runtime: styles are extracted to static CSS at build time, with type-safe tokens and recipes.
Most state is local or server data, and neither needs a global store. Lift state up first, use context for rarely changing values, a data-fetching library for server state, and a small store only for genuinely shared client state.
Built in and enough for theme, locale and the signed-in user. Every consumer re-renders when the value changes, so it is not a high-frequency store.
A tiny hook-based store with selectors, so components re-render only when the slice they read changes. No providers needed.
Atomic state: small independent atoms composed into derived ones, re-rendering only what depends on them.
Observable state with automatic tracking: mutate objects directly and observer components update.
Headless libraries give you behaviour and accessibility — focus management, keyboard support, ARIA — with no styles, so they fit any design system. The hard parts of dialogs, menus and comboboxes, done right.
Unstyled, accessible primitives — Dialog, Popover, Tabs, Select — composed from parts. The foundation of shadcn/ui.
Unstyled components from the makers of Radix, Material UI and Floating UI, with a focus on accessibility and composition.
Adobe's hooks and components with the most thorough accessibility and internationalisation coverage available.
Headless components built on state machines, sharing one implementation across React, Vue, Solid and Svelte.
Server data is not client state: it needs caching, deduplication, background refetching and invalidation after mutations. Use a data-fetching library instead of fetch-in-useEffect — for REST and for GraphQL.
Query keys, caching, stale-while-revalidate, retries, pagination, optimistic updates and mutations — the default for REST server state.
A small stale-while-revalidate hook from Vercel: cache, revalidate on focus, dedupe requests.
Redux Toolkit's data-fetching layer — a good fit when the app already uses Redux.
An HTTP client with interceptors and automatic JSON. It sends requests; pair it with a caching library rather than using it alone.
The most widely used GraphQL client: a normalised cache, hooks for queries and mutations, and dev tools.
Meta's GraphQL client: each component declares its data with fragments, and the compiler builds efficient queries.
A lightweight, extensible GraphQL client built around exchanges, with an optional normalised cache.
Test what users see and do, not implementation details: unit tests for logic, component tests that render and interact, and a few end-to-end tests through real browsers for critical flows.
A fast, Vite-native test runner with a Jest-compatible API — the natural choice for Vite projects.
The long-time standard runner with built-in mocks and snapshots.
Render components and query them the way users do — by role, label and text — then interact with user-event.
End-to-end tests across Chromium, Firefox and WebKit with auto-waiting, traces and component testing.
Browser end-to-end and component testing with an interactive, time-travelling runner.
The React team recommends starting with a framework: routing, data loading, server rendering and bundling solved together, with server components and server functions available.
The most popular React framework: the App Router, server components, server actions, streaming and caching. This site has its own Next.js roadmap.
Content-first sites that ship zero JavaScript by default, with React components hydrated only where you opt in as islands.
React Router's framework mode (the successor to Remix): file-based routes, loaders, actions and server rendering.
Forms combine state, validation, accessibility and submission. React 19 adds form actions and useActionState; libraries handle complex validation and large forms efficiently.
Uncontrolled-input forms with minimal re-renders and schema validation through resolvers (Zod, Valibot).
A controlled-form library common in older codebases; little active development today.
Formisch: a small, schema-first, type-safe form library from the author of Valibot.
Types catch mistakes while you write code; runtime validation catches bad data from forms and APIs. Together they let a schema be the single source of truth for both.
Typed props, state and events, generic components and discriminated unions for variants. Practically the default for professional React.
Schemas that validate at runtime and infer TypeScript types, for forms, API responses and environment variables.
A modular, tree-shakable alternative to Zod with a much smaller bundle.
Motion guides attention and explains change. Animate transforms and opacity for smooth frames, use layout and exit animations for list and route changes, and always respect prefers-reduced-motion.
Now called Motion: declarative motion.* components with gestures, layout animations and AnimatePresence for exits.
Physics-based spring animations driven by hooks, for natural-feeling motion.
A professional timeline animation library — scroll-driven scenes, SVG and complex sequences — with the useGSAP hook for React cleanup.
A rendering error unmounts the whole tree unless a boundary catches it and shows a fallback. Wrap independent sections so one failure does not blank the page, and report the error. Boundaries do not catch event-handler or async errors.
React renders on the server too: streaming HTML with renderToPipeableStream or renderToReadableStream, and in frameworks, server components that never ship to the client plus server functions called from forms. Learn where the server/client boundary goes.
<Suspense> shows a fallback while children wait for code (lazy) or data (use, framework data loading), and lets the server stream HTML in pieces. Place boundaries where a loading state makes sense to the user.
createPortal renders children into a different DOM node — for modals, toasts and tooltips that must escape overflow: hidden or stacking contexts — while staying in the React tree for context and events.
The same React model drives native iOS and Android apps, rendering real native views instead of a web page.
Native apps with React components (View, Text, Pressable). Start with Expo for builds, routing and over-the-air updates.