Profiler

A React component, and a React DevTools tab, that measures how often and how long parts of the tree render.

In more detail

Wrap a subtree in <Profiler id="app" onRender={fn}> and React calls fn after each commit with the phase (mount or update), actualDuration and baseDuration. Profile before optimising, so you fix measured slow spots rather than guesses.

Related terms

Taught in

References