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

Function pushHostContext

code/controlled-uncontrolled/public/app.js:11257–11271  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

11255 }
11256
11257 function pushHostContext(fiber) {
11258 var rootInstance = requiredContext(rootInstanceStackCursor.current);
11259 var context = requiredContext(contextStackCursor.current);
11260 var nextContext = getChildHostContext(context, fiber.type, rootInstance);
11261
11262 // Don't push this Fiber's context unless it's unique.
11263 if (context === nextContext) {
11264 return;
11265 }
11266
11267 // Track the context and the Fiber that provided it.
11268 // This enables us to pop only Fibers that provide unique contexts.
11269 push(contextFiberStackCursor, fiber, fiber);
11270 push(contextStackCursor, nextContext, fiber);
11271 }
11272
11273 function popHostContext(fiber) {
11274 // Do not pop unless this Fiber provided the current context.

Callers 1

updateHostComponentFunction · 0.70

Calls 2

requiredContextFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected