Watch React hooks run, one line at a time

HookViz replays real React executions statement by statement. See the source line, the hook list, the effects queue and the DOM change together, so a stale closure or a missing dependency shows up as a step you can point at.

22 examples · React 19.2.8 · recorded, not simulated

why two setCount calls only increment oncestep 12 / 38

Variables

count0

Hooks

0 useState0 → queued 1

Both calls read count as 0 from this render’s closure, so the queue holds 1, not 2.

rendercommitevent

Six views of the same step

Every panel shows the same moment in the recording. Move the timeline and they all move together.

Source
The component code. The current statement is highlighted, and the gutter marks closures and side effects.
Rendered output
The DOM as React committed it, one snapshot per commit. Changed output flashes once.
Hooks
React’s hook list for this component: type, index, stored value, and any updates waiting in the queue.
Effects queue
Each effect moves from scheduled to fired, then cleanup pending and cleaned up.
Variables
Local values at the current statement. Anything that just changed is marked.
Timeline
Every recorded step, coloured by phase. Click anywhere to jump there.

Four phases, four colours

Colour appears in HookViz only where it names a phase. If you can tell the phase, you can tell why the step ran.

render

React calls your component. Hooks read their stored state and return it.

commit

React applies the result to the DOM. The rendered output changes here.

passive-effect

useEffect callbacks and cleanups run after the browser has painted.

event

A click or timer fires your handler. State updates are queued, not applied.

22 examples, grouped by hook

Each one is a real component recorded under a debugger. Start with the gotchas: batching, stale closures and fetch races.