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

Function popHydrationState

bundle.js:7649–7659  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

7647fiber.updateQueue=updatePayload;// If the update payload indicates that there is a change or if there
7648// is a new ref we mark this as an update.
7649if(updatePayload!==null){return true;}return false;}function prepareToHydrateHostTextInstance(fiber){var textInstance=fiber.stateNode;var shouldUpdate=hydrateTextInstance(textInstance,fiber.memoizedProps,fiber);return shouldUpdate;}function popToNextHostParent(fiber){var parent=fiber['return'];while(parent!==null&&parent.tag!==HostComponent$10&&parent.tag!==HostRoot$10){parent=parent['return'];}hydrationParentFiber=parent;}function popHydrationState(fiber){if(fiber!==hydrationParentFiber){// We're deeper than the current hydration context, inside an inserted
7650// tree.
7651return false;}if(!isHydrating){// If we're not currently hydrating but we're in a hydration context, then
7652// we were an insertion and now need to pop up reenter hydration of our
7653// siblings.
7654popToNextHostParent(fiber);isHydrating=true;return false;}var type=fiber.type;// If we have any remaining hydratable nodes, we need to delete them now.
7655// We only do this deeper than head and body since they tend to have random
7656// other nodes in them. We also ignore components with pure text content in
7657// side of them.
7658// TODO: Better heuristic.
7659if(fiber.tag!==HostComponent$10||type!=='head'&&type!=='body'&&!shouldSetTextContent(type,fiber.memoizedProps)){var nextInstance=nextHydratableInstance;while(nextInstance){deleteHydratableInstance(fiber,nextInstance);nextInstance=getNextHydratableSibling(nextInstance);}}popToNextHostParent(fiber);nextHydratableInstance=hydrationParentFiber?getNextHydratableSibling(fiber.stateNode):null;return true;}function resetHydrationState(){hydrationParentFiber=null;nextHydratableInstance=null;isHydrating=false;}return{enterHydrationState:enterHydrationState,resetHydrationState:resetHydrationState,tryToClaimNextHydratableInstance:tryToClaimNextHydratableInstance,prepareToHydrateHostInstance:prepareToHydrateHostInstance,prepareToHydrateHostTextInstance:prepareToHydrateHostTextInstance,popHydrationState:popHydrationState};};/**
7660 * Copyright (c) 2013-present, Facebook, Inc.
7661 *
7662 * This source code is licensed under the MIT license found in the

Callers 1

completeWorkFunction · 0.85

Calls 2

popToNextHostParentFunction · 0.85
deleteHydratableInstanceFunction · 0.85

Tested by

no test coverage detected