Skip to main content

How React Works: The Complete Tutorial

This course starts from "I've shipped React" and ends at "I can explain what React is doing." No source-code walkthroughs, no file names. Each concept is built with plain explanations, runnable examples, walkthroughs, and diagrams.

Who this is for: frontend engineers who know JavaScript, have written components, and have never sat with what happens under the hood.

What you need: about an hour of JavaScript prerequisites (chapter 0.1) and the patience to read in order.

What's inside: 51 chapters across 9 parts, 100+ rendered diagrams.

The learning path​

Part 0: Start here​

#ChapterWhat it gives you
0.1JavaScript you actually needClosures, event loop, micro vs macrotasks, Object.is, immutability. The five things later chapters assume.

Part 1: Foundations: the mental model​

#ChapterWhat it gives you
1.1The problem React solvesWhy manual DOM syncing breaks, and the declarative answer
1.2UI is a function of stateThe formula everything else follows from
1.3Elements are just objectsWhat JSX actually creates
1.4JSX under the hoodThe transform, the rules, the syntax traps
1.5Components and purityWhy render must be pure. Later chapters depend on this.
1.6Render and commitThe two phases. The most important split in React.

Part 2: The engine​

#ChapterWhat it gives you
2.1The fiber treeReact's internal tree, and where state actually lives
2.2Two trees: double bufferingCurrent vs draft tree; why renders are disposable
2.3Diffing, step by stepReconciliation rules and full traces
2.4Keys and identityWhat keys actually do (identity, not performance)
2.5How the DOM gets updatedMinimal mutations, flags, the commit sequence

Part 3: State & hooks​

#ChapterWhat it gives you
3.1What state really isMemory tied to tree position
3.2setState is a requestBatching, queues, the +1-not-+3 classic
3.3Hooks: the linked listThe one mechanism behind all hooks
3.4Rules of hooks, explainedWhy the rules exist, derived from the mechanism
3.5useState deep diveLazy init, Object.is bailout, mutation bugs
3.6useEffect deep diveSynchronization, not lifecycle; cleanups; races
3.7useLayoutEffect & timingThe paint timeline; when each effect fires
3.8useRef: the mutable boxThe sanctioned escape hatch
3.9useMemo & useCallbackReferential stability, the real reason they exist
3.10Context deep divePropagation mechanics; why it bypasses memo
3.11useReducer & advanced stateReducers, optimistic updates, state machines

Part 4: Concurrency: React's scheduler​

#ChapterWhat it gives you
4.1The main thread problemWhy one thread doing everything is the constraint
4.2Time-slicingHow React yields every ~5ms to keep the page alive
4.3Priority lanesClicks > typing > transitions > hidden; preemption
4.4Concurrent renderingInterruptible, discardable renders
4.5TransitionsstartTransition, isPending, the no-downgrade rule
4.6useDeferredValueThe lagging-copy pattern for expensive UI
4.7External stores & tearingWhy useSyncExternalStore exists

Part 5: Suspense & errors​

#ChapterWhat it gives you
5.1Suspense mental modelTry/catch for "not ready yet"
5.2Throwing promisesThe full mechanism, step by step
5.3Boundaries & retriesPlacement, granularity, waterfalls
5.4Suspense with transitionsWhy old screens stay visible
5.5Error boundariesThe error twin; what it can and can't catch

Part 6: React DOM​

#ChapterWhat it gives you
6.1createRoot & the first renderWhat the entry point actually sets up
6.2Synthetic eventsRoot delegation, what onClick really is
6.3Controlled inputsThe enforcement loop that rarely gets taught
6.4PortalsDifferent DOM address, same React family

Part 7: Server rendering​

#ChapterWhat it gives you
7.1SSR & hydrationHTML first, interactivity second
7.2Selective hydrationIslands, event replay, mismatches
7.3Server componentsComponents that never ship to the browser
7.4RSC streamingUI as streamed data; server actions
7.5Streaming SSRShell + progressive boundary swaps

Part 8: Performance​

#ChapterWhat it gives you
8.1Wasted rendersMeasure first; the three structural fixes
8.2React.memoShallow compare, and the three ways it silently fails
8.3State structure patternsColocation, derived state, key resets, normalization
8.4The React CompilerAuto-memoization, what it does and how to think about it

Part 9: Advanced​

#ChapterWhat it gives you
9.1StrictModeThe double-everything development X-ray
9.2Escape hatchesflushSync, imperative handles, act, last resorts
9.3Offscreen & ActivityHidden but alive: preserved trees
9.4The misconceptions master list24 myths, busted with proof