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

Function deleteHydratableInstance

bundle.js:7625–7630  ·  view source on GitHub ↗
(returnFiber,instance)

Source from the content-addressed store, hash-verified

7623if(!(canHydrateInstance&&canHydrateTextInstance&&getNextHydratableSibling&&getFirstHydratableChild&&hydrateInstance&&hydrateTextInstance&&didNotHydrateInstance&&didNotFindHydratableInstance&&didNotFindHydratableTextInstance)){return{enterHydrationState:function enterHydrationState(){return false;},resetHydrationState:function resetHydrationState(){},tryToClaimNextHydratableInstance:function tryToClaimNextHydratableInstance(){},prepareToHydrateHostInstance:function prepareToHydrateHostInstance(){invariant(false,'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');},prepareToHydrateHostTextInstance:function prepareToHydrateHostTextInstance(){invariant(false,'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');},popHydrationState:function popHydrationState(fiber){return false;}};}// The deepest Fiber on the stack involved in a hydration context.
7624// This may have been an insertion or a hydration.
7625var hydrationParentFiber=null;var nextHydratableInstance=null;var isHydrating=false;function enterHydrationState(fiber){var parentInstance=fiber.stateNode.containerInfo;nextHydratableInstance=getFirstHydratableChild(parentInstance);hydrationParentFiber=fiber;isHydrating=true;return true;}function deleteHydratableInstance(returnFiber,instance){{switch(returnFiber.tag){case HostRoot$10:didNotHydrateInstance(returnFiber.stateNode.containerInfo,instance);break;case HostComponent$10:didNotHydrateInstance(returnFiber.stateNode,instance);break;}}var childToDelete=createFiberFromHostInstanceForDeletion$1();childToDelete.stateNode=instance;childToDelete['return']=returnFiber;childToDelete.effectTag=Deletion$2;// This might seem like it belongs on progressedFirstDeletion. However,
7626// these children are not part of the reconciliation list of children.
7627// Even if we abort and rereconcile the children, that will try to hydrate
7628// again and the nodes are still in the host tree so these will be
7629// recreated.
7630if(returnFiber.lastEffect!==null){returnFiber.lastEffect.nextEffect=childToDelete;returnFiber.lastEffect=childToDelete;}else{returnFiber.firstEffect=returnFiber.lastEffect=childToDelete;}}function insertNonHydratedInstance(returnFiber,fiber){fiber.effectTag|=Placement$6;{var parentInstance;switch(returnFiber.tag){// TODO: Currently we don't warn for insertions into the root because
7631// we always insert into the root in the non-hydrating case. We just
7632// delete the existing content. Reenable this once we have a better
7633// strategy for determining if we're hydrating or not.

Callers 2

popHydrationStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected