MCPcopy Create free account
hub / github.com/plotly/dash / recordPassiveEffectDuration

Function recordPassiveEffectDuration

dash/deps/react-dom@18.3.1.js:17741–17777  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

17739 }
17740
17741 function recordPassiveEffectDuration(fiber) {
17742
17743 if (passiveEffectStartTime >= 0) {
17744 var elapsedTime = now$1() - passiveEffectStartTime;
17745 passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor
17746 // Or the root (for the DevTools Profiler to read)
17747
17748 var parentFiber = fiber.return;
17749
17750 while (parentFiber !== null) {
17751 switch (parentFiber.tag) {
17752 case HostRoot:
17753 var root = parentFiber.stateNode;
17754
17755 if (root !== null) {
17756 root.passiveEffectDuration += elapsedTime;
17757 }
17758
17759 return;
17760
17761 case Profiler:
17762 var parentStateNode = parentFiber.stateNode;
17763
17764 if (parentStateNode !== null) {
17765 // Detached fibers have their state node cleared out.
17766 // In this case, the return pointer is also cleared out,
17767 // so we won't be able to report the time spent in this Profiler's subtree.
17768 parentStateNode.passiveEffectDuration += elapsedTime;
17769 }
17770
17771 return;
17772 }
17773
17774 parentFiber = parentFiber.return;
17775 }
17776 }
17777 }
17778
17779 function startLayoutEffectTimer() {
17780

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…