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

Function ReactFiberCommitWork

code/dependency-injection/public/app.js:11309–11976  ·  view source on GitHub ↗
(config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime)

Source from the content-addressed store, hash-verified

11307}
11308
11309var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11310 var getPublicInstance = config.getPublicInstance,
11311 mutation = config.mutation,
11312 persistence = config.persistence;
11313
11314
11315 var callComponentWillUnmountWithTimer = function (current, instance) {
11316 startPhaseTimer(current, 'componentWillUnmount');
11317 instance.props = current.memoizedProps;
11318 instance.state = current.memoizedState;
11319 instance.componentWillUnmount();
11320 stopPhaseTimer();
11321 };
11322
11323 // Capture errors so they don't interrupt unmounting.
11324 function safelyCallComponentWillUnmount(current, instance) {
11325 {
11326 invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance);
11327 if (hasCaughtError$1()) {
11328 var unmountError = clearCaughtError$1();
11329 captureError(current, unmountError);
11330 }
11331 }
11332 }
11333
11334 function safelyDetachRef(current) {
11335 var ref = current.ref;
11336 if (ref !== null) {
11337 if (typeof ref === 'function') {
11338 {
11339 invokeGuardedCallback$3(null, ref, null, null);
11340 if (hasCaughtError$1()) {
11341 var refError = clearCaughtError$1();
11342 captureError(current, refError);
11343 }
11344 }
11345 } else {
11346 ref.current = null;
11347 }
11348 }
11349 }
11350
11351 function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) {
11352 switch (finishedWork.tag) {
11353 case ClassComponent:
11354 {
11355 var _instance = finishedWork.stateNode;
11356 if (finishedWork.effectTag & Update) {
11357 if (current === null) {
11358 startPhaseTimer(finishedWork, 'componentDidMount');
11359 _instance.props = finishedWork.memoizedProps;
11360 _instance.state = finishedWork.memoizedState;
11361 _instance.componentDidMount();
11362 stopPhaseTimer();
11363 } else {
11364 var prevProps = current.memoizedProps;
11365 var prevState = current.memoizedState;
11366 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