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

Function ReactFiberClassComponent

code/event-handlers/public/app.js:7532–8127  ·  view source on GitHub ↗
(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState)

Source from the content-addressed store, hash-verified

7530}
7531
7532var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) {
7533 var cacheContext = legacyContext.cacheContext,
7534 getMaskedContext = legacyContext.getMaskedContext,
7535 getUnmaskedContext = legacyContext.getUnmaskedContext,
7536 isContextConsumer = legacyContext.isContextConsumer,
7537 hasContextChanged = legacyContext.hasContextChanged;
7538
7539 // Class component state updater
7540
7541 var updater = {
7542 isMounted: isMounted,
7543 enqueueSetState: function (instance, partialState, callback) {
7544 var fiber = get(instance);
7545 callback = callback === undefined ? null : callback;
7546 {
7547 warnOnInvalidCallback$1(callback, 'setState');
7548 }
7549 var expirationTime = computeExpirationForFiber(fiber);
7550 var update = {
7551 expirationTime: expirationTime,
7552 partialState: partialState,
7553 callback: callback,
7554 isReplace: false,
7555 isForced: false,
7556 capturedValue: null,
7557 next: null
7558 };
7559 insertUpdateIntoFiber(fiber, update);
7560 scheduleWork(fiber, expirationTime);
7561 },
7562 enqueueReplaceState: function (instance, state, callback) {
7563 var fiber = get(instance);
7564 callback = callback === undefined ? null : callback;
7565 {
7566 warnOnInvalidCallback$1(callback, 'replaceState');
7567 }
7568 var expirationTime = computeExpirationForFiber(fiber);
7569 var update = {
7570 expirationTime: expirationTime,
7571 partialState: state,
7572 callback: callback,
7573 isReplace: true,
7574 isForced: false,
7575 capturedValue: null,
7576 next: null
7577 };
7578 insertUpdateIntoFiber(fiber, update);
7579 scheduleWork(fiber, expirationTime);
7580 },
7581 enqueueForceUpdate: function (instance, callback) {
7582 var fiber = get(instance);
7583 callback = callback === undefined ? null : callback;
7584 {
7585 warnOnInvalidCallback$1(callback, 'forceUpdate');
7586 }
7587 var expirationTime = computeExpirationForFiber(fiber);
7588 var update = {
7589 expirationTime: expirationTime,

Callers 1

ReactFiberBeginWorkFunction · 0.70

Calls 4

getFunction · 0.70
insertUpdateIntoFiberFunction · 0.70
scheduleWorkFunction · 0.70

Tested by

no test coverage detected