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.
Variables
Hooks
Both calls read count as 0 from this render’s closure, so the queue holds 1, not 2.
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.
React calls your component. Hooks read their stored state and return it.
React applies the result to the DOM. The rendered output changes here.
useEffect callbacks and cleanups run after the browser has painted.
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.