MCPcopy Create free account
hub / github.com/microsoft/SandDance / prepareToReadContext

Function prepareToReadContext

docs/external/js/react-dom.development.js:12199–12218  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

12197 }
12198 }
12199 function prepareToReadContext(workInProgress, renderExpirationTime) {
12200 currentlyRenderingFiber = workInProgress;
12201 lastContextDependency = null;
12202 lastContextWithAllBitsObserved = null;
12203 var dependencies = workInProgress.dependencies;
12204
12205 if (dependencies !== null) {
12206 var firstContext = dependencies.firstContext;
12207
12208 if (firstContext !== null) {
12209 if (dependencies.expirationTime >= renderExpirationTime) {
12210 // Context list has a pending update. Mark that this fiber performed work.
12211 markWorkInProgressReceivedUpdate();
12212 } // Reset the work-in-progress list
12213
12214
12215 dependencies.firstContext = null;
12216 }
12217 }
12218 }
12219 function readContext(context, observedBits) {
12220 {
12221 // This warning would fire if you read context inside a Hook like useMemo.

Callers 6

updateForwardRefFunction · 0.85
updateFunctionComponentFunction · 0.85
updateClassComponentFunction · 0.85
updateContextConsumerFunction · 0.85

Calls 1

Tested by

no test coverage detected