React Reference
|
This section documents React 19.x for the web, using function components and Hooks throughout (class components appear only where React still requires them, such as error boundaries). React Native is out of scope and gets only a pointer. The React 19 additions follow the current official React documentation. This content was generated with the assistance of AI and should be verified against react.dev before being relied on in production, since React APIs continue to evolve between releases. This section’s bibliography lists the reference material consulted while preparing these pages. |
Welcome to the React reference. React is a declarative, component-based JavaScript library for building user interfaces: you describe the UI for each state, and React updates the DOM to match. This section documents React 19 for the web, using function components and Hooks throughout.
If you are new to React, start with Getting Started with React and JSX and Rendering, then work down the list or jump to what you need.
What’s covered
Fundamentals
-
Getting Started with React — what React is, the virtual DOM and reconciliation, what is new in React 19, and creating an app with a framework or with Vite.
-
JSX and Rendering — JSX syntax, embedding expressions with curly braces, conditional rendering, rendering lists with keys, and mounting a tree with
createRoot. -
Components and Props — function components, passing and reading props,
children, one-way data flow, composition over inheritance, and keeping components pure. -
State and Events — event handlers and the
SyntheticEvent,useState, the render/commit cycle, batching and updater functions, and immutable object/array updates.
Hooks & effects
-
Core Hooks and the Rules of Hooks — the Rules of Hooks,
useStatevs.useReducer,useRefanduseId, and a reference table of every built-in Hook. -
Effects and Lifecycle —
useEffect, dependency arrays and cleanup, fetching with a race guard, "you might not need an Effect",useEffectEvent, anduseLayoutEffect. -
Custom Hooks — extracting stateful logic into
use*functions, and worked examples (useToggle,useLocalStorage,useDebounce,useFetch,useOnlineStatus).
State, performance & Suspense
-
State Management — lifting state up, controlled vs. uncontrolled inputs, structuring state, Context, the reducer + context pattern, and third-party libraries.
-
Performance and Concurrent Features — measuring re-renders,
memo/useMemo/useCallback, the React Compiler,useTransitionanduseDeferredValue. -
Code Splitting and Suspense —
lazy+<Suspense>, route-based splitting, Suspense for data and theuseAPI, and error boundaries.
Forms, routing & data
-
Forms and Actions — controlled inputs, and the React 19 Actions model with
useActionState,useFormStatus, anduseOptimistic. -
Routing — a brief orientation: React ships no router; the options, and minimal React Router examples.
-
Data Fetching —
fetchin an Effect and its problems,axios, TanStack Query / SWR, GraphQL clients, and framework data loading. -
Refs and the DOM —
useReffor non-rendering values, DOM refs,refas a prop in React 19,useImperativeHandle, andflushSync.
TypeScript & testing
-
TypeScript with React — typing props,
children, hooks, and events; generic components and utility types; and the removal ofPropTypesin React 19. -
Testing — the test pyramid, Jest / Vitest setup, React Testing Library and
act(), mocking the network with MSW, testing Hooks, and end-to-end tests with Playwright and Cypress.
Rendering, build & delivery
-
Server Rendering, SSG and React Server Components — CSR/SSR/SSG/ISR, hydration,
react-dom/serverand streaming, RSC and Server Functions, and an SEO-friendly e-commerce example. -
Build and Deployment — what a bundler does, building with Vite, the three deployment models, and a worked Vite SPA on AWS S3 + CloudFront.
-
Styling and UI Libraries — CSS Modules, Tailwind, CSS-in-JS, component libraries (MUI, Ant Design, Chakra UI, PrimeReact, gluestack, Radix), and accessibility of interactive components.
Reference
-
The Rules of React — purity and idempotency, no side effects in render, immutable props and state, letting React call your components and Hooks, and the Rules of Hooks.
-
Cheat sheet — a one-page, downloadable PDF summary of the essentials above for quick memorization.
Bibliography
-
Sakhniuk, Mikhail & Boduch, Adam. React and React Native, 5th ed. Packt Publishing, 2024. ISBN 978-1-80512-730-7 (print), 978-1-80512-687-4 (ebook). The primary reference for this section (Part I, "React", chapters 1—14) — see the publisher’s book page and packtpub.com, with the official code bundle at PacktPublishing/React-and-React-Native-5E.
-
react.dev — the official React documentation, used to verify every API and to cover everything React-19-specific: Learn,
reactreference,react-domreference, Rules of React, the blog, and versions. -
MDN Web Docs — for the web-platform APIs React builds on (
fetch, the DOM, events), cross-linked from Data Fetching and Refs and the DOM. -
Ecosystem documentation cited in this section: React Router, TanStack Query, Redux Toolkit, React Testing Library, Vite, and Next.js.