MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / ReactFiberCommitWork

Function ReactFiberCommitWork

code/new-context-api/public/app.js:10577–11244  ·  view source on GitHub ↗
(config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime)

Source from the content-addressed store, hash-verified

10575}
10576
10577var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
10578 var getPublicInstance = config.getPublicInstance,
10579 mutation = config.mutation,
10580 persistence = config.persistence;
10581
10582
10583 var callComponentWillUnmountWithTimer = function (current, instance) {
10584 startPhaseTimer(current, 'componentWillUnmount');
10585 instance.props = current.memoizedProps;
10586 instance.state = current.memoizedState;
10587 instance.componentWillUnmount();
10588 stopPhaseTimer();
10589 };
10590
10591 // Capture errors so they don't interrupt unmounting.
10592 function safelyCallComponentWillUnmount(current, instance) {
10593 {
10594 invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance);
10595 if (hasCaughtError$1()) {
10596 var unmountError = clearCaughtError$1();
10597 captureError(current, unmountError);
10598 }
10599 }
10600 }
10601
10602 function safelyDetachRef(current) {
10603 var ref = current.ref;
10604 if (ref !== null) {
10605 if (typeof ref === 'function') {
10606 {
10607 invokeGuardedCallback$3(null, ref, null, null);
10608 if (hasCaughtError$1()) {
10609 var refError = clearCaughtError$1();
10610 captureError(current, refError);
10611 }
10612 }
10613 } else {
10614 ref.current = null;
10615 }
10616 }
10617 }
10618
10619 function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) {
10620 switch (finishedWork.tag) {
10621 case ClassComponent:
10622 {
10623 var _instance = finishedWork.stateNode;
10624 if (finishedWork.effectTag & Update) {
10625 if (current === null) {
10626 startPhaseTimer(finishedWork, 'componentDidMount');
10627 _instance.props = finishedWork.memoizedProps;
10628 _instance.state = finishedWork.memoizedState;
10629 _instance.componentDidMount();
10630 stopPhaseTimer();
10631 } else {
10632 var prevProps = current.memoizedProps;
10633 var prevState = current.memoizedState;
10634 startPhaseTimer(finishedWork, 'componentDidUpdate');

Callers 1

ReactFiberSchedulerFunction · 0.70

Calls 3

invariantFunction · 0.70
commitNestedUnmountsFunction · 0.70
detachFiberFunction · 0.70

Tested by

no test coverage detected