How do you use React DevTools with Next.js?

Install the React Developer Tools browser extension, run the app (dev mode gives the most detail), and use the Components tab to inspect the tree, props, state and hooks, and the Profiler tab to record renders. Client Components are fully inspectable; Server Components appear in the tree with a "Server" badge and their props, but have no state.

Components tab

  • Select an element on the page to find its component.
  • Inspect and edit props, state and hook values live.
  • See which components are Server Components (labelled) versus Client Components.
  • Toggle Suspense boundaries to preview fallbacks, and force error boundaries to show error.tsx UI.
  • Jump to source for a component.

Profiler tab

  • Record an interaction to see which components rendered, how long they took and why ("props changed", "hook 2 changed").
  • Enable "Highlight updates when components render" to spot unnecessary re-renders.
  • With the React Compiler (reactCompiler: true), components it memoized show a "Memo ✨" badge.

Production profiling

Production builds strip most profiling hooks. Use next build --profile to create a build with profiling enabled.

Related tools

  • Next.js DevTools (in-page indicator) for route, cache and navigation insights.
  • Chrome Performance panel with React's "Scheduler" and "Components" tracks (React 19.2) for timing.
  • TanStack Query or Redux DevTools for client state libraries.

Code example

tsx
1// Profile a production-like build
2// next build --profile && next start
3
4// Use <Profiler> programmatically for quick timing of a subtree
5"use client";
6
7import { Profiler, type ProfilerOnRenderCallback } from "react";
8
9const onRender: ProfilerOnRenderCallback = (id, phase, actualDuration) => {
10 if (actualDuration > 16) console.warn(`[${id}] ${phase} took ${actualDuration.toFixed(1)}ms`);
11};
12
13export function ProfiledTable({ children }: { children: React.ReactNode }) {
14 return (
15 <Profiler id="OrdersTable" onRender={onRender}>
16 {children}
17 </Profiler>
18 );
19}

Practice this question

Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the Next.js set.

Open in study app