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

Function ReactFiberCommitWork

code/composition/public/app.js:11354–12021  ·  view source on GitHub ↗
(config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime)

Source from the content-addressed store, hash-verified

11352}
11353
11354var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11355 var getPublicInstance = config.getPublicInstance,
11356 mutation = config.mutation,
11357 persistence = config.persistence;
11358
11359
11360 var callComponentWillUnmountWithTimer = function (current, instance) {
11361 startPhaseTimer(current, 'componentWillUnmount');
11362 instance.props = current.memoizedProps;
11363 instance.state = current.memoizedState;
11364 instance.componentWillUnmount();
11365 stopPhaseTimer();
11366 };
11367
11368 // Capture errors so they don't interrupt unmounting.
11369 function safelyCallComponentWillUnmount(current, instance) {
11370 {
11371 invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance);
11372 if (hasCaughtError$1()) {
11373 var unmountError = clearCaughtError$1();
11374 captureError(current, unmountError);
11375 }
11376 }
11377 }
11378
11379 function safelyDetachRef(current) {
11380 var ref = current.ref;
11381 if (ref !== null) {
11382 if (typeof ref === 'function') {
11383 {
11384 invokeGuardedCallback$3(null, ref, null, null);
11385 if (hasCaughtError$1()) {
11386 var refError = clearCaughtError$1();
11387 captureError(current, refError);
11388 }
11389 }
11390 } else {
11391 ref.current = null;
11392 }
11393 }
11394 }
11395
11396 function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) {
11397 switch (finishedWork.tag) {
11398 case ClassComponent:
11399 {
11400 var _instance = finishedWork.stateNode;
11401 if (finishedWork.effectTag & Update) {
11402 if (current === null) {
11403 startPhaseTimer(finishedWork, 'componentDidMount');
11404 _instance.props = finishedWork.memoizedProps;
11405 _instance.state = finishedWork.memoizedState;
11406 _instance.componentDidMount();
11407 stopPhaseTimer();
11408 } else {
11409 var prevProps = current.memoizedProps;
11410 var prevState = current.memoizedState;
11411 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