Course contentsShow
← React
Lesson 2229 of 2,39649. Performance: Identifying ProblemsFree lesson

The 'Record why each component rendered' Setting

Enable this Profiler option to see exact reasons (props, state, hooks) that caused each component to render in a commit.

The 'Record why each component rendered' Setting

What you'll learn: How to enable React DevTools' most powerful diagnostic feature to see the exact reason behind every component render.

What This Setting Does

When you enable "Record why each component rendered" in the React DevTools Profiler settings (⚙️ icon), React tracks and displays precisely what changed to trigger each component's render during your profiling session. Instead of guessing whether it was a prop change, state update, or hook dependency, you get concrete evidence.

Why This Matters

Remember when we learned to spot "wasted renders" and use React.memo to verify them? That detective work required manual inspection and educated guesses. With this setting enabled, the Profiler tells you exactly:

  • Which prop changed (and shows old vs new values)
  • Which state variable updated
  • Which hook triggered the re-render
  • Whether the parent forced a re-render

How to Use It

  1. Open React DevTools Profiler
  2. Click the settings gear icon (⚙️)
  3. Check "Record why each component rendered"
  4. Start a new profiling session
  5. After stopping, click any component in the flame graph
  6. Look at the right panel—you'll see the specific trigger

Think of it like a security camera that not only shows someone entered your house, but also displays which door they used and at what time. Instead of reviewing logs manually, you have frame-by-frame evidence.

The Performance Trade-off

This feature adds overhead to profiling, so your recorded performance numbers will be slightly slower than reality. That's acceptable—you're trading precision measurement for diagnostic clarity.

Key Takeaway: Enable "Record why each component rendered" to transform the Profiler from showing that components rendered to showing exactly why, revealing the specific props, state, or hooks responsible for each update.