MCPcopy Create free account
hub / github.com/reactjs/react-rails / prepareToReadContext

Function prepareToReadContext

lib/assets/react-source/development/react.js:15759–15778  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

15757 }
15758 }
15759 function prepareToReadContext(workInProgress, renderExpirationTime) {
15760 currentlyRenderingFiber = workInProgress;
15761 lastContextDependency = null;
15762 lastContextWithAllBitsObserved = null;
15763 var dependencies = workInProgress.dependencies;
15764
15765 if (dependencies !== null) {
15766 var firstContext = dependencies.firstContext;
15767
15768 if (firstContext !== null) {
15769 if (dependencies.expirationTime >= renderExpirationTime) {
15770 // Context list has a pending update. Mark that this fiber performed work.
15771 markWorkInProgressReceivedUpdate();
15772 } // Reset the work-in-progress list
15773
15774
15775 dependencies.firstContext = null;
15776 }
15777 }
15778 }
15779 function readContext(context, observedBits) {
15780 {
15781 // 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