React · Middle · Question 66 of 75

What is the <Profiler> component for?

<Profiler id="Sidebar" onRender={(id, phase, actualDuration) => log(id, actualDuration)}>
  <Sidebar />
</Profiler>

Explanation

It adds some overhead and is disabled in production builds by default. The DevTools Profiler is usually enough for manual investigation.

Further reading

Problem with a question

React · Middle · question 66

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz