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

Function ReactFiberCommitWork

code/communication/public/app.js:11251–11918  ·  view source on GitHub ↗
(config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime)

Source from the content-addressed store, hash-verified

11249}
11250
11251var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11252 var getPublicInstance = config.getPublicInstance,
11253 mutation = config.mutation,
11254 persistence = config.persistence;
11255
11256
11257 var callComponentWillUnmountWithTimer = function (current, instance) {
11258 startPhaseTimer(current, 'componentWillUnmount');
11259 instance.props = current.memoizedProps;
11260 instance.state = current.memoizedState;
11261 instance.componentWillUnmount();
11262 stopPhaseTimer();
11263 };
11264
11265 // Capture errors so they don't interrupt unmounting.
11266 function safelyCallComponentWillUnmount(current, instance) {
11267 {
11268 invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance);
11269 if (hasCaughtError$1()) {
11270 var unmountError = clearCaughtError$1();
11271 captureError(current, unmountError);
11272 }
11273 }
11274 }
11275
11276 function safelyDetachRef(current) {
11277 var ref = current.ref;
11278 if (ref !== null) {
11279 if (typeof ref === 'function') {
11280 {
11281 invokeGuardedCallback$3(null, ref, null, null);
11282 if (hasCaughtError$1()) {
11283 var refError = clearCaughtError$1();
11284 captureError(current, refError);
11285 }
11286 }
11287 } else {
11288 ref.current = null;
11289 }
11290 }
11291 }
11292
11293 function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) {
11294 switch (finishedWork.tag) {
11295 case ClassComponent:
11296 {
11297 var _instance = finishedWork.stateNode;
11298 if (finishedWork.effectTag & Update) {
11299 if (current === null) {
11300 startPhaseTimer(finishedWork, 'componentDidMount');
11301 _instance.props = finishedWork.memoizedProps;
11302 _instance.state = finishedWork.memoizedState;
11303 _instance.componentDidMount();
11304 stopPhaseTimer();
11305 } else {
11306 var prevProps = current.memoizedProps;
11307 var prevState = current.memoizedState;
11308 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