Comparing Renders: Why Did This Update Happen?
What you'll learn: How to navigate between recorded commits in the Profiler to pinpoint exactly which props or state changes caused a component to re-render.
The Investigation Workflow
You've identified a component that rendered unnecessarily or too frequently using the Ranked Chart or Flamegraph. Now what? The Profiler lets you click through different commits (snapshots of render cycles) to see what changed between them.
When you select a component in a specific commit, the right panel shows "Why did this render?" information. You'll see:
- Props changes: Which props received new values (and what those values were)
- State changes: Which state variables updated
- Hooks changes: Which hook values changed (context, reducers, etc.)
- Parent rendered: Whether this was just a cascade from a parent re-rendering
Navigating Between Commits
Use the commit selector (arrows or timeline) at the top of the Profiler to step through each render cycle. This is like watching a replay of your app's behavior frame-by-frame. As you move between commits, watch the "Why did this render?" section for the same component—you'll see exactly when userId changed from 5 to 7, or when isOpen flipped from false to true.
The Detective's Moment
This is where you catch the culprit. Maybe you discover that a style prop is being recreated as a new object every render, or that a handleClick function isn't wrapped in useCallback. The Profiler shows you the smoking gun—not just that something rendered, but why.
Key Takeaway: Comparing commits reveals the specific prop, state, or hook changes that triggered each re-render, transforming vague performance suspicions into concrete optimization targets.