MCPcopy
hub / github.com/facebook/react / updateProfiler

Function updateProfiler

packages/react-reconciler/src/ReactFiberBeginWork.js:1356–1380  ·  view source on GitHub ↗
(
  current: Fiber | null,
  workInProgress: Fiber,
  renderLanes: Lanes,
)

Source from the content-addressed store, hash-verified

1354}
1355
1356function updateProfiler(
1357 current: Fiber | null,
1358 workInProgress: Fiber,
1359 renderLanes: Lanes,
1360) {
1361 if (enableProfilerTimer) {
1362 workInProgress.flags |= Update;
1363
1364 if (enableProfilerCommitHooks) {
1365 // Schedule a passive effect for this Profiler to call onPostCommit hooks.
1366 // This effect should be scheduled even if there is no onPostCommit callback for this Profiler,
1367 // because the effect is also where times bubble to parent Profilers.
1368 workInProgress.flags |= Passive;
1369 // Reset effect durations for the next eventual effect phase.
1370 // These are reset during render to allow the DevTools commit hook a chance to read them,
1371 const stateNode = workInProgress.stateNode;
1372 stateNode.effectDuration = -0;
1373 stateNode.passiveEffectDuration = -0;
1374 }
1375 }
1376 const nextProps: ProfilerProps = workInProgress.pendingProps;
1377 const nextChildren = nextProps.children;
1378 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
1379 return workInProgress.child;
1380}
1381
1382function markRef(current: Fiber | null, workInProgress: Fiber) {
1383 // TODO: Check props.ref instead of fiber.ref when enableRefAsProp is on.

Callers 1

beginWorkFunction · 0.85

Calls 1

reconcileChildrenFunction · 0.85

Tested by

no test coverage detected