Q35: How does the <Profiler> component measure React rendering performance?

The <Profiler> component wraps React subtrees to measure rendering performance metrics, invoking an onRender callback with details like render duration, commit time, and phase ('mount' or 'update').

Key Takeaways
  • Measures rendering cost and re-render frequencies programmatically.

  • Accepts id and onRender callback props.

Knowledge Check

Which prop callback must be supplied to the React <Profiler> component?