Hint
React DevTools Profiler records renders — shows which component rendered, why, and how long it took
The React DevTools Profiler helps identify slow renders and unnecessary re-renders.
Using React DevTools Profiler:
The Profiler API for automated performance testing:
import { Profiler } from 'react';
function onRenderCallback(
id, // tree id (prop)
phase, // "mount" | "update" | "nested-update"
actualDuration, // time spent rendering committed update
baseDuration, // estimated time without memoization
startTime,
commitTime
) {
if (actualDuration > 16) { // over one 60fps frame
console.warn(`Slow render in ${id}: ${actualDuration}ms`);
}
}
function App() {
return (
);
}
What to look for: