โš›๏ธ

React in Depth: From Hooks to Source Code

Master React 19 from the ground up: JSX compilation, Hooks internals, state management, performance optimization, engineering best practices, and deep dives into Fiber architecture and Reconciler source code. Covers React 18โ†’19 key changes. 28 chapters, completely free.

28
Chapters
Free
Forever
Start Reading →
Table of Contents
Ch01
JSX Internals and the Compilation Pipeline
JSX isn't HTML โ€” compilation transform, createElement call chain, and the new JSX transform in React 19
Ch02
Component Model: The Real Difference Between Function and Class Components
Why function components replaced class components โ€” closure traps, render semantics, and component identity
Ch03
Props, State and Data Flow Design
The philosophy of unidirectional data flow, Props immutability, state lifting and component communication patterns
Ch04
React Event System Deep Dive
Synthetic events, event delegation, React 17 event system refactor, and pitfalls when mixing with native events
Ch05
useState: Batching and Async State Update Mechanics
State snapshots, automatic batching in React 18, functional updates, and lazy state initialization
Ch06
useEffect: The Right Way to Handle Side Effects
What dependency arrays really mean, cleanup functions, common misuse patterns, and changes in React 19
Ch07
useRef and DOM Manipulation: The Complete Ref Handbook
Three uses of refs, forwardRef, useImperativeHandle, and React 19's ref-as-prop change
Ch08
useMemo and useCallback: When to Optimize, When to Over-Engineer
The real cost of memoization, referential stability, and a decision framework for when optimization is actually needed
Ch09
useContext: Dependency Injection and Performance Pitfalls
Context propagation, unnecessary re-renders, strategies for splitting context, and the new use() Hook
Ch10
Custom Hooks: Abstraction, Reuse and Design Patterns
When to extract custom hooks, common patterns (useFetch/useLocalStorage/useDebounce), and design principles
Ch11
The Limits of Context: What Problems It Cannot Solve
Context is not a state management library โ€” performance issues, organization problems, and when you need external solutions
Ch12
Zustand: The Design Philosophy of Minimal State Management
Zustand core API, middleware system, React integration internals, and source code walkthrough
Ch13
Redux Toolkit: Enterprise State Management Complete Guide
Modern RTK patterns, createSlice/createAsyncThunk, RTK Query for data fetching and caching
Ch14
Atomic State: Jotai, Valtio and Recoil Compared
Design differences between three atomic state solutions, use cases, performance characteristics, and how to choose
Ch15
Re-render Mechanics: When React Re-renders and How to Prevent It
All conditions that trigger re-renders, render tree propagation rules, and targeted optimization strategies
Ch16
React.memo and the Complete Re-render Control System
Shallow comparison in memo, collaboration with useMemo/useCallback, and when memo doesn't help
Ch17
Code Splitting, Lazy Loading and Suspense Boundaries
React.lazy, dynamic imports, Suspense fallback design, and coordination with error boundaries
Ch18
React Profiler in Practice: Finding and Fixing Performance Bottlenecks
DevTools Profiler usage, flame graph interpretation, real-world case analysis, and optimization verification
Ch19
TypeScript + React: Type-Safe Component Design
Component prop types, generic components, event types, Hook type inference, and common type pitfalls
Ch20
Testing Strategy: Complete Guide to Vitest + React Testing Library
Unit tests, integration tests, user behavior testing, mock strategies, and CI integration
Ch21
Error Boundaries and a Complete Error Handling System
ErrorBoundary implementation, error reporting, React 19 error handling improvements, and production strategies
Ch22
Accessibility (a11y) Engineering in Practice
Semantic HTML, ARIA attributes, keyboard navigation, screen reader testing, and automated accessibility checks
Ch23
Project Architecture and Engineering Best Practices
Directory structure design, component layering, barrel export controversy, monorepo solutions, and code standards
Ch24
Fiber Architecture: Why React Rewrote Its Rendering Engine
Stack Reconciler bottlenecks, Fiber node data structure, work loop, and interruptible rendering
Ch25
Reconciler and Diff Algorithm Source Code Walkthrough
reconcileChildFibers implementation, three Diff rules, the role of keys, and Diff algorithm complexity
Ch26
Scheduler: React's Concurrent Scheduling System
Priority model, time slicing, MessageChannel implementation, and coordination with browser frames
Ch27
Hooks Linked List: How useState and useEffect Are Implemented
Hook object structure, mount vs update dispatchers, and the relationship between closures and linked lists
Ch28
React 19 Complete: Actions, use(), Compiler and Concurrent Improvements
All React 19 new features explained, differences from React 18, migration guide, and future direction

๐Ÿ’ฌ Comments