function onRenderCallback(
id, // the "id" prop of the Profiler tree that has just committed
phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered)
actualDuration, // time spent rendering the committed update
baseDuration, // estimated time to render the entire subtree without memoization
startTime, // when React began rendering this update
commitTime, // when React committed this update
interactions // the Set of interactions belonging to this update
) {
// Aggregate or log render timings...
}
React.StrictMode
function ExampleApplication() { return (
); }
React.Suspense
延迟加载组件,当组件未准备好时,显示 loading
ReactDOM.createPortal
将组件挂载在任意节点
Profiler
测量渲染一个 React 应用多久渲染一次以及渲染一次的“代价”