React DevTools Cheat Sheet

Subject: React

πŸ“˜ 1. Components Tab

πŸ”§ Featureβœ… What It Does
Component TreeDisplays your full app as a tree of React components
Expand/CollapseView parent-child relationships in deeply nested components
Props ViewerShows all props passed to a component
State ViewerShows useState / this.state values; editable live
Hook InspectorView all hooks like useState, useEffect, with current values
Highlight in DOMHover to highlight the corresponding DOM element
Search BarFind components by name (e.g., type "Header")

πŸ§ͺ Example:

Inspecting <Counter /> might show:

  • props: { start: 0 }
  • hooks: count = 3 βœ… You can edit count live to test UI!

πŸ“˜ 2. Editing Props / State / Hooks

FeatureDescription
Live Edit PropsDouble-click any prop to change it live
Live Edit StateClick state variable and update value instantly
Edit Hook ValuesWorks for useReducer, useContext, etc.

πŸ” Why it’s useful:

  • Instantly test UI without code changes
  • Debug forms, inputs, or API behavior

πŸ“˜ 3. Highlight Component on Page

FeatureDescription
πŸ” Highlight on hoverHover tree to highlight the DOM element
βœ… Toggle highlightingUse the "target" icon to turn highlighting on/off

🧠 Use Case: Perfect for debugging layout and style issues.


πŸ“˜ 4. Profiler Tab

Only visible in development mode with Profiler enabled.

FeatureDescription
⏱ Record RendersStart/stop to capture re-render info
πŸ”₯ Flame GraphVisualize which components took time to render
πŸ“Š Ranked ViewSort components by render time

πŸ’‘ Use Case:

  • Identify bottlenecks
  • Optimize performance-heavy components

πŸ“˜ 5. Component Source Location

FeatureDescription
πŸ“„ Jump to SourceShow file and line of component (via source maps)
πŸ”— Click-to-openClick path to open file in IDE (if properly configured)

πŸ“˜ 6. Hooks Display

Hook TypeWhat You See in DevTools
useStateVariable name and current value (e.g., count: 5)
useReducerState and dispatch function info
useEffectNot directly shown, but rerender timing shows in Profiler
useContextDisplays current context value inside component tree

πŸ“˜ 7. React Strict Mode Support

If using <React.StrictMode>, DevTools helps you:

  • See double renders
  • Spot unsafe lifecycle methods
  • Detect unexpected state mutations

You’ll find warnings in the Profiler or browser console.


πŸ” Summary Table

FeatureWhat It DoesUse Case
Component TreeView component hierarchyUnderstand structure
Props/State/Hook InspectorLive view + edit of component dataTest dynamic behavior
Highlight in DOMConnect UI with component logicDebug layout issues
ProfilerMeasure render performanceOptimize slow parts of app
Jump to SourceFind component code quicklyDebug/edit faster
Search ComponentsFilter by component nameExplore large apps
Edit in DevToolsSimulate form input, auth, error UI statesFaster than code editing for testing

πŸ§ͺ Final Tip: Use it Like a Debug Console for React

React DevTools is your React Command Center β€” it helps you:

  • 🐞 Debug more easily
  • βš™οΈ Understand unfamiliar apps
  • πŸš€ Optimize performance
  • πŸ§ͺ Test UI states without rewriting code