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

Function ReactFiberClassComponent

code/communication/public/app.js:8237–8832  ·  view source on GitHub ↗
(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState)

Source from the content-addressed store, hash-verified

8235}
8236
8237var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) {
8238 var cacheContext = legacyContext.cacheContext,
8239 getMaskedContext = legacyContext.getMaskedContext,
8240 getUnmaskedContext = legacyContext.getUnmaskedContext,
8241 isContextConsumer = legacyContext.isContextConsumer,
8242 hasContextChanged = legacyContext.hasContextChanged;
8243
8244 // Class component state updater
8245
8246 var updater = {
8247 isMounted: isMounted,
8248 enqueueSetState: function (instance, partialState, callback) {
8249 var fiber = get(instance);
8250 callback = callback === undefined ? null : callback;
8251 {
8252 warnOnInvalidCallback$1(callback, 'setState');
8253 }
8254 var expirationTime = computeExpirationForFiber(fiber);
8255 var update = {
8256 expirationTime: expirationTime,
8257 partialState: partialState,
8258 callback: callback,
8259 isReplace: false,
8260 isForced: false,
8261 capturedValue: null,
8262 next: null
8263 };
8264 insertUpdateIntoFiber(fiber, update);
8265 scheduleWork(fiber, expirationTime);
8266 },
8267 enqueueReplaceState: function (instance, state, callback) {
8268 var fiber = get(instance);
8269 callback = callback === undefined ? null : callback;
8270 {
8271 warnOnInvalidCallback$1(callback, 'replaceState');
8272 }
8273 var expirationTime = computeExpirationForFiber(fiber);
8274 var update = {
8275 expirationTime: expirationTime,
8276 partialState: state,
8277 callback: callback,
8278 isReplace: true,
8279 isForced: false,
8280 capturedValue: null,
8281 next: null
8282 };
8283 insertUpdateIntoFiber(fiber, update);
8284 scheduleWork(fiber, expirationTime);
8285 },
8286 enqueueForceUpdate: function (instance, callback) {
8287 var fiber = get(instance);
8288 callback = callback === undefined ? null : callback;
8289 {
8290 warnOnInvalidCallback$1(callback, 'forceUpdate');
8291 }
8292 var expirationTime = computeExpirationForFiber(fiber);
8293 var update = {
8294 expirationTime: expirationTime,

Callers 1

ReactFiberBeginWorkFunction · 0.70

Calls 4

getFunction · 0.70
insertUpdateIntoFiberFunction · 0.70
scheduleWorkFunction · 0.70

Tested by

no test coverage detected