Question presented to candidate: "Walk me through React DevTools. What are the panels, and what do you actually use each one for?"
What a strong answer should cover:
- A browser extension (and a standalone package for React Native and other environments) adding two panels to the browser devtools.
- Components panel: the component tree, with live props, state, hooks, and context for the selected node — and the ability to edit them in place.
- Profiler panel: records a session and shows each commit, how long it took, which components rendered, and — with the setting enabled — why each one rendered.
- Key workflow: "Highlight updates when components render" to see wasted re-renders visually.
- The flamegraph vs ranked chart distinction, and that grey components are ones that did not re-render.
- Practical touches:
$rin the console for the selected component, owner-based filtering, and hiding host elements to reduce noise. - Signal of depth: the Profiler needs a development build or a production build with profiling enabled; a plain production build shows nothing useful.
Clarifying questions expected:
- "Are we debugging correctness — wrong data on screen — or performance?" The panel differs.
Code / implementation expected: No. This is a tooling walkthrough.