MCPcopy Index your code
hub / github.com/plotly/dash / commitPassiveEffectDurations

Function commitPassiveEffectDurations

dash/deps/react-dom@18.2.0.js:23210–23261  ·  view source on GitHub ↗
(finishedRoot, finishedWork)

Source from the content-addressed store, hash-verified

23208 }
23209
23210 function commitPassiveEffectDurations(finishedRoot, finishedWork) {
23211 {
23212 // Only Profilers with work in their subtree will have an Update effect scheduled.
23213 if ((finishedWork.flags & Update) !== NoFlags) {
23214 switch (finishedWork.tag) {
23215 case Profiler:
23216 {
23217 var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
23218 var _finishedWork$memoize = finishedWork.memoizedProps,
23219 id = _finishedWork$memoize.id,
23220 onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase.
23221 // It does not get reset until the start of the next commit phase.
23222
23223 var commitTime = getCommitTime();
23224 var phase = finishedWork.alternate === null ? 'mount' : 'update';
23225
23226 {
23227 if (isCurrentUpdateNested()) {
23228 phase = 'nested-update';
23229 }
23230 }
23231
23232 if (typeof onPostCommit === 'function') {
23233 onPostCommit(id, phase, passiveEffectDuration, commitTime);
23234 } // Bubble times to the next nearest ancestor Profiler.
23235 // After we process that Profiler, we'll bubble further up.
23236
23237
23238 var parentFiber = finishedWork.return;
23239
23240 outer: while (parentFiber !== null) {
23241 switch (parentFiber.tag) {
23242 case HostRoot:
23243 var root = parentFiber.stateNode;
23244 root.passiveEffectDuration += passiveEffectDuration;
23245 break outer;
23246
23247 case Profiler:
23248 var parentStateNode = parentFiber.stateNode;
23249 parentStateNode.passiveEffectDuration += passiveEffectDuration;
23250 break outer;
23251 }
23252
23253 parentFiber = parentFiber.return;
23254 }
23255
23256 break;
23257 }
23258 }
23259 }
23260 }
23261 }
23262
23263 function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) {
23264 if ((finishedWork.flags & LayoutMask) !== NoFlags) {

Callers 1

flushPassiveEffectsImplFunction · 0.70

Calls 2

getCommitTimeFunction · 0.70
isCurrentUpdateNestedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…