How to read the player
A trace is one recorded run of a React component. The player does not run your code live. It replays what happened, so you can stop on any statement and look around.
Your first trace
- Open why two setCount calls only increment once.
- Press play, or step with the arrow keys, until the source panel reaches the second setCount(count + 1).
- In the Hooks panel the stored value is still 0 while the queue holds 1. Both calls read the same snapshot of count.
- Keep stepping to the commit. The rendered output changes once, to 1, not 2.
Panels
Source shows the component and the current statement. Rendered output shows the DOM after each commit. Hooks lists each hook with its stored value and queued updates. Effects queue tracks every effect from scheduled to cleaned up. Variables shows local values at the current line. Rows that just changed flash briefly.
Phases
The bar at the bottom is the whole recording, split by phase: render, commit, passive-effect and event. Click it to jump to any step.
Guided and Expert
Guided shows a short note for each interesting step and marks closures and side effects in the gutter. Expert hides them. Your choice is remembered in this browser.
Controls
Where the traces come from
Each example is a real React component, executed once at build time under the V8 debugger with React’s own renderer. HookViz stores one snapshot per statement. Nothing on this page simulates React.