MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / pushHostContainer

Function pushHostContainer

bundle.js:7613–7617  ·  view source on GitHub ↗
(fiber,nextRootInstance)

Source from the content-addressed store, hash-verified

7611if(current===null&&finishedWork.effectTag&Update$3){var type=finishedWork.type;var props=finishedWork.memoizedProps;commitMount(_instance2,type,props,finishedWork);}return;}case HostText$7:{// We have no life-cycles associated with text.
7612return;}case HostPortal$7:{// We have no life-cycles associated with portals.
7613return;}default:{invariant(false,'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');}}}function commitAttachRef(finishedWork){var ref=finishedWork.ref;if(ref!==null){var instance=finishedWork.stateNode;switch(finishedWork.tag){case HostComponent$9:ref(getPublicInstance(instance));break;default:ref(instance);}}}function commitDetachRef(current){var currentRef=current.ref;if(currentRef!==null){currentRef(null);}}return{commitPlacement:commitPlacement,commitDeletion:commitDeletion,commitWork:commitWork,commitLifeCycles:commitLifeCycles,commitAttachRef:commitAttachRef,commitDetachRef:commitDetachRef};};var createCursor$2=ReactFiberStack.createCursor;var pop$2=ReactFiberStack.pop;var push$2=ReactFiberStack.push;var NO_CONTEXT={};var ReactFiberHostContext=function ReactFiberHostContext(config){var getChildHostContext=config.getChildHostContext,getRootHostContext=config.getRootHostContext;var contextStackCursor=createCursor$2(NO_CONTEXT);var contextFiberStackCursor=createCursor$2(NO_CONTEXT);var rootInstanceStackCursor=createCursor$2(NO_CONTEXT);function requiredContext(c){!(c!==NO_CONTEXT)?invariant(false,'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.'):void 0;return c;}function getRootHostContainer(){var rootInstance=requiredContext(rootInstanceStackCursor.current);return rootInstance;}function pushHostContainer(fiber,nextRootInstance){// Push current root instance onto the stack;
7614// This allows us to reset root when portals are popped.
7615push$2(rootInstanceStackCursor,nextRootInstance,fiber);var nextRootContext=getRootHostContext(nextRootInstance);// Track the context and the Fiber that provided it.
7616// This enables us to pop only Fibers that provide unique contexts.
7617push$2(contextFiberStackCursor,fiber,fiber);push$2(contextStackCursor,nextRootContext,fiber);}function popHostContainer(fiber){pop$2(contextStackCursor,fiber);pop$2(contextFiberStackCursor,fiber);pop$2(rootInstanceStackCursor,fiber);}function getHostContext(){var context=requiredContext(contextStackCursor.current);return context;}function pushHostContext(fiber){var rootInstance=requiredContext(rootInstanceStackCursor.current);var context=requiredContext(contextStackCursor.current);var nextContext=getChildHostContext(context,fiber.type,rootInstance);// Don't push this Fiber's context unless it's unique.
7618if(context===nextContext){return;}// Track the context and the Fiber that provided it.
7619// This enables us to pop only Fibers that provide unique contexts.
7620push$2(contextFiberStackCursor,fiber,fiber);push$2(contextStackCursor,nextContext,fiber);}function popHostContext(fiber){// Do not pop unless this Fiber provided the current context.

Callers 3

pushHostRootContextFunction · 0.85
updatePortalComponentFunction · 0.85
bailoutOnLowPriorityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected