MCPcopy Index your code
hub / github.com/react/react / commitRootCallbacks

Function commitRootCallbacks

packages/react-reconciler/src/ReactFiberCommitEffects.js:591–619  ·  view source on GitHub ↗
(finishedWork: Fiber)

Source from the content-addressed store, hash-verified

589}
590
591export function commitRootCallbacks(finishedWork: Fiber) {
592 // TODO: I think this is now always non-null by the time it reaches the
593 // commit phase. Consider removing the type check.
594 const updateQueue: UpdateQueue<mixed> | null =
595 (finishedWork.updateQueue: any);
596 if (updateQueue !== null) {
597 let instance = null;
598 if (finishedWork.child !== null) {
599 switch (finishedWork.child.tag) {
600 case HostSingleton:
601 case HostComponent:
602 instance = getPublicInstance(finishedWork.child.stateNode);
603 break;
604 case ClassComponent:
605 instance = finishedWork.child.stateNode;
606 break;
607 }
608 }
609 try {
610 if (__DEV__) {
611 runWithFiberInDEV(finishedWork, commitCallbacks, updateQueue, instance);
612 } else {
613 commitCallbacks(updateQueue, instance);
614 }
615 } catch (error) {
616 captureCommitPhaseError(finishedWork, finishedWork.return, error);
617 }
618 }
619}
620
621let didWarnAboutUndefinedSnapshotBeforeUpdate: Set<mixed> | null = null;
622if (__DEV__) {

Callers 1

Calls 4

getPublicInstanceFunction · 0.90
runWithFiberInDEVFunction · 0.90
commitCallbacksFunction · 0.90
captureCommitPhaseErrorFunction · 0.90

Tested by

no test coverage detected