MCPcopy Create free account
hub / github.com/plotly/dash / pushHostContainer

Function pushHostContainer

dash/deps/react-dom@18.3.1.js:15091–15108  ·  view source on GitHub ↗
(fiber, nextRootInstance)

Source from the content-addressed store, hash-verified

15089 }
15090
15091 function pushHostContainer(fiber, nextRootInstance) {
15092 // Push current root instance onto the stack;
15093 // This allows us to reset root when portals are popped.
15094 push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
15095 // This enables us to pop only Fibers that provide unique contexts.
15096
15097 push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
15098 // However, we can't just call getRootHostContext() and push it because
15099 // we'd have a different number of entries on the stack depending on
15100 // whether getRootHostContext() throws somewhere in renderer code or not.
15101 // So we push an empty value first. This lets us safely unwind on errors.
15102
15103 push(contextStackCursor$1, NO_CONTEXT, fiber);
15104 var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
15105
15106 pop(contextStackCursor$1, fiber);
15107 push(contextStackCursor$1, nextRootContext, fiber);
15108 }
15109
15110 function popHostContainer(fiber) {
15111 pop(contextStackCursor$1, fiber);

Callers 3

pushHostRootContextFunction · 0.70
updatePortalComponentFunction · 0.70

Calls 3

pushFunction · 0.70
getRootHostContextFunction · 0.70
popFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…