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

Function ReactFiberCommitWork

code/styling/public/app.js:11216–11883  ·  view source on GitHub ↗
(config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime)

Source from the content-addressed store, hash-verified

11214}
11215
11216var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11217 var getPublicInstance = config.getPublicInstance,
11218 mutation = config.mutation,
11219 persistence = config.persistence;
11220
11221
11222 var callComponentWillUnmountWithTimer = function (current, instance) {
11223 startPhaseTimer(current, 'componentWillUnmount');
11224 instance.props = current.memoizedProps;
11225 instance.state = current.memoizedState;
11226 instance.componentWillUnmount();
11227 stopPhaseTimer();
11228 };
11229
11230 // Capture errors so they don't interrupt unmounting.
11231 function safelyCallComponentWillUnmount(current, instance) {
11232 {
11233 invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance);
11234 if (hasCaughtError$1()) {
11235 var unmountError = clearCaughtError$1();
11236 captureError(current, unmountError);
11237 }
11238 }
11239 }
11240
11241 function safelyDetachRef(current) {
11242 var ref = current.ref;
11243 if (ref !== null) {
11244 if (typeof ref === 'function') {
11245 {
11246 invokeGuardedCallback$3(null, ref, null, null);
11247 if (hasCaughtError$1()) {
11248 var refError = clearCaughtError$1();
11249 captureError(current, refError);
11250 }
11251 }
11252 } else {
11253 ref.current = null;
11254 }
11255 }
11256 }
11257
11258 function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) {
11259 switch (finishedWork.tag) {
11260 case ClassComponent:
11261 {
11262 var _instance = finishedWork.stateNode;
11263 if (finishedWork.effectTag & Update) {
11264 if (current === null) {
11265 startPhaseTimer(finishedWork, 'componentDidMount');
11266 _instance.props = finishedWork.memoizedProps;
11267 _instance.state = finishedWork.memoizedState;
11268 _instance.componentDidMount();
11269 stopPhaseTimer();
11270 } else {
11271 var prevProps = current.memoizedProps;
11272 var prevState = current.memoizedState;
11273 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