⚛️ Learn React — Engineering Reference

A code-first, production-grade React curriculum for mid-to-senior developers. Each chapter is structured around annotated code blocks — complex implementations, anti-patterns with fixes, performance tricks, and edge-case failure modes — rather than prose-heavy tutorials. Every concept is shown as it's used in real production systems, with dense inline comments explaining the underlying React mechanics.

How to Use This Reference

  1. Read sequentially (01 → 26) for a structured path from JSX to production security.
  2. Jump to a chapter as a reference when you hit a specific React problem — each is self-contained.
  3. Build the projects in chapter 26 after every few chapters.
  4. Read the React source and popular library internals (TanStack Query, Zustand) alongside.

Prerequisites

  • Modern JavaScript (ES2015+): arrow functions, destructuring, modules, promises/async-await.
  • Node.js and a package manager (npm, pnpm, or yarn).
  • A code editor (VS Code recommended).
  • Familiarity with at least one other UI framework or sufficient general web development experience — this reference moves fast on fundamentals.

Curriculum

Part I — Foundations

#TopicWhy It Matters
01Introduction & SetupToolchain, project scaffolding, mental model.
02JSX Deep DiveSyntax, expressions, escaping, compilation to createElement.
03Components & PropsComposition unit, prop patterns, children.
04State & useStateLocal state, batching, functional updates.
05Event HandlingSynthetic events, delegation, handler patterns.

Part II — Hooks & Side Effects

#TopicWhy It Matters
06useEffect & LifecycleSynchronization, cleanup, dependency arrays.
07useContext & Prop DrillingSharing state without threading props.
08useRef & DOM AccessMutable values, imperative DOM access.
09useMemo & useCallbackMemoization, referential equality.
10useReducer & Complex StateAction-based state transitions.
11Custom HooksExtracting and reusing stateful logic.

Part III — Rendering Patterns

#TopicWhy It Matters
12Conditional Rendering Patterns&&, ternaries, early returns, pitfalls.
13Lists, Keys & ReconciliationDiffing algorithm, key stability.
14Forms: Controlled and UncontrolledInput state, validation, refs vs. state.
15Composition vs. InheritanceSlots, render props, compound components.
16Error BoundariesCatching render errors, fallback UI.

Part IV — Data & State at Scale

#TopicWhy It Matters
17Fetching DataEffects, loading/error states, aborting requests.
18Context and State Management LibrariesRedux, Zustand, when Context isn't enough.
19Routing with React RouterClient-side navigation, dynamic routes.

Part V — Performance & Modern React

#TopicWhy It Matters
20Performance OptimizationProfiling, memo, virtualization.
21Concurrent FeaturesuseTransition, useDeferredValue, Suspense.
22Server Components and SSRRSC, streaming, hydration.

Part VI — Production Engineering

#TopicWhy It Matters
23TypeScript with ReactTyped props, hooks, generics, event types.
24TestingReact Testing Library, mocking, interaction tests.
25SecurityXSS boundaries, dependency risk, secrets, CSP.
26Exercises & Project IdeasFrom beginner to pro.

Learning Path Suggestions

If you're new to frontend development

  1. Read 01–11 in order, slowly — hooks are the foundation everything else builds on.
  2. Skim 12–16, then build Project 1 (Todo List) from chapter 26.
  3. Read 17–19, then build Projects 2–4.
  4. Come back for 20–25 once you have a few working apps under your belt.

If you're coming from another framework (Vue, Angular, Svelte)

Read 02–05 quickly — concepts translate, only syntax and mental model differ. Slow down for 06 (useEffect) and 09 (useMemo/useCallback) — dependency arrays and referential equality are React-specific traps. Read 18 to compare React's state-management story with what you already know.

If you're coming from jQuery or vanilla JS

Ownership of the DOM shifts entirely to React — read 02, 03, and 13 carefully before anything else. Resist the urge to reach for useRef-driven manual DOM manipulation as a first instinct; read 04 and 14 until declarative state feels natural.

If you're a senior engineer learning React for production

Skim 01–11. Read 17, 18, 20, 21, 22 closely. Use 23 and 25 as ongoing references. Then read 26 and build the intermediate and advanced projects.

Companion Resources

Tooling to Install

bash
npm create vite@latest my-app -- --template react-ts
npm install -D eslint eslint-plugin-react-hooks prettier
npm install -D vitest @testing-library/react @testing-library/user-event jsdom

License

These notes are yours to use, share, and modify.

⚛️