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

Function pushHostContainer

docs/external/js/react-dom.development.js:14553–14570  ·  view source on GitHub ↗
(fiber, nextRootInstance)

Source from the content-addressed store, hash-verified

14551 }
14552
14553 function pushHostContainer(fiber, nextRootInstance) {
14554 // Push current root instance onto the stack;
14555 // This allows us to reset root when portals are popped.
14556 push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
14557 // This enables us to pop only Fibers that provide unique contexts.
14558
14559 push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
14560 // However, we can't just call getRootHostContext() and push it because
14561 // we'd have a different number of entries on the stack depending on
14562 // whether getRootHostContext() throws somewhere in renderer code or not.
14563 // So we push an empty value first. This lets us safely unwind on errors.
14564
14565 push(contextStackCursor$1, NO_CONTEXT, fiber);
14566 var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
14567
14568 pop(contextStackCursor$1, fiber);
14569 push(contextStackCursor$1, nextRootContext, fiber);
14570 }
14571
14572 function popHostContainer(fiber) {
14573 pop(contextStackCursor$1, fiber);

Callers 3

pushHostRootContextFunction · 0.85
updatePortalComponentFunction · 0.85
beginWorkFunction · 0.85

Calls 3

getRootHostContextFunction · 0.85
pushFunction · 0.70
popFunction · 0.70

Tested by

no test coverage detected