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

Function commitRootImpl

dash/deps/react-dom@18.3.1.js:26740–27015  ·  view source on GitHub ↗
(root, recoverableErrors, transitions, renderPriorityLevel)

Source from the content-addressed store, hash-verified

26738 }
26739
26740 function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) {
26741 do {
26742 // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
26743 // means `flushPassiveEffects` will sometimes result in additional
26744 // passive effects. So we need to keep flushing in a loop until there are
26745 // no more pending effects.
26746 // TODO: Might be better if `flushPassiveEffects` did not automatically
26747 // flush synchronous work at the end, to avoid factoring hazards like this.
26748 flushPassiveEffects();
26749 } while (rootWithPendingPassiveEffects !== null);
26750
26751 flushRenderPhaseStrictModeWarningsInDEV();
26752
26753 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
26754 throw new Error('Should not already be working.');
26755 }
26756
26757 var finishedWork = root.finishedWork;
26758 var lanes = root.finishedLanes;
26759
26760 {
26761 markCommitStarted(lanes);
26762 }
26763
26764 if (finishedWork === null) {
26765
26766 {
26767 markCommitStopped();
26768 }
26769
26770 return null;
26771 } else {
26772 {
26773 if (lanes === NoLanes) {
26774 error('root.finishedLanes should not be empty during a commit. This is a ' + 'bug in React.');
26775 }
26776 }
26777 }
26778
26779 root.finishedWork = null;
26780 root.finishedLanes = NoLanes;
26781
26782 if (finishedWork === root.current) {
26783 throw new Error('Cannot commit the same tree as before. This error is likely caused by ' + 'a bug in React. Please file an issue.');
26784 } // commitRoot never returns a continuation; it always finishes synchronously.
26785 // So we can clear these now to allow a new callback to be scheduled.
26786
26787
26788 root.callbackNode = null;
26789 root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first
26790 // pending time is whatever is left on the root fiber.
26791
26792 var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
26793 markRootFinished(root, remainingLanes);
26794
26795 if (root === workInProgressRoot) {
26796 // We can reset these now that they are finished.
26797 workInProgressRoot = null;

Callers 1

commitRootFunction · 0.70

Calls 15

flushPassiveEffectsFunction · 0.70
markCommitStartedFunction · 0.70
markCommitStoppedFunction · 0.70
errorFunction · 0.70
mergeLanesFunction · 0.70
markRootFinishedFunction · 0.70
scheduleCallback$1Function · 0.70
getCurrentUpdatePriorityFunction · 0.70
setCurrentUpdatePriorityFunction · 0.70
recordCommitTimeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…