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

Function ReactFiberClassComponent

code/third-party/public/app.js:7435–8030  ·  view source on GitHub ↗
(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState)

Source from the content-addressed store, hash-verified

7433}
7434
7435var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) {
7436 var cacheContext = legacyContext.cacheContext,
7437 getMaskedContext = legacyContext.getMaskedContext,
7438 getUnmaskedContext = legacyContext.getUnmaskedContext,
7439 isContextConsumer = legacyContext.isContextConsumer,
7440 hasContextChanged = legacyContext.hasContextChanged;
7441
7442 // Class component state updater
7443
7444 var updater = {
7445 isMounted: isMounted,
7446 enqueueSetState: function (instance, partialState, callback) {
7447 var fiber = get(instance);
7448 callback = callback === undefined ? null : callback;
7449 {
7450 warnOnInvalidCallback$1(callback, 'setState');
7451 }
7452 var expirationTime = computeExpirationForFiber(fiber);
7453 var update = {
7454 expirationTime: expirationTime,
7455 partialState: partialState,
7456 callback: callback,
7457 isReplace: false,
7458 isForced: false,
7459 capturedValue: null,
7460 next: null
7461 };
7462 insertUpdateIntoFiber(fiber, update);
7463 scheduleWork(fiber, expirationTime);
7464 },
7465 enqueueReplaceState: function (instance, state, callback) {
7466 var fiber = get(instance);
7467 callback = callback === undefined ? null : callback;
7468 {
7469 warnOnInvalidCallback$1(callback, 'replaceState');
7470 }
7471 var expirationTime = computeExpirationForFiber(fiber);
7472 var update = {
7473 expirationTime: expirationTime,
7474 partialState: state,
7475 callback: callback,
7476 isReplace: true,
7477 isForced: false,
7478 capturedValue: null,
7479 next: null
7480 };
7481 insertUpdateIntoFiber(fiber, update);
7482 scheduleWork(fiber, expirationTime);
7483 },
7484 enqueueForceUpdate: function (instance, callback) {
7485 var fiber = get(instance);
7486 callback = callback === undefined ? null : callback;
7487 {
7488 warnOnInvalidCallback$1(callback, 'forceUpdate');
7489 }
7490 var expirationTime = computeExpirationForFiber(fiber);
7491 var update = {
7492 expirationTime: expirationTime,

Callers 1

ReactFiberBeginWorkFunction · 0.70

Calls 4

getFunction · 0.70
insertUpdateIntoFiberFunction · 0.70
scheduleWorkFunction · 0.70

Tested by

no test coverage detected