MCPcopy
hub / github.com/plotly/dash / pushHostContainer

Function pushHostContainer

dash/deps/react-dom@18.2.0.js:15910–15927  ·  view source on GitHub ↗
(fiber, nextRootInstance)

Source from the content-addressed store, hash-verified

15908 }
15909
15910 function pushHostContainer(fiber, nextRootInstance) {
15911 // Push current root instance onto the stack;
15912 // This allows us to reset root when portals are popped.
15913 push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
15914 // This enables us to pop only Fibers that provide unique contexts.
15915
15916 push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
15917 // However, we can't just call getRootHostContext() and push it because
15918 // we'd have a different number of entries on the stack depending on
15919 // whether getRootHostContext() throws somewhere in renderer code or not.
15920 // So we push an empty value first. This lets us safely unwind on errors.
15921
15922 push(contextStackCursor$1, NO_CONTEXT, fiber);
15923 var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
15924
15925 pop(contextStackCursor$1, fiber);
15926 push(contextStackCursor$1, nextRootContext, fiber);
15927 }
15928
15929 function popHostContainer(fiber) {
15930 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…