(fiber)
| 12463 | } |
| 12464 | |
| 12465 | function popHydrationState(fiber) { |
| 12466 | if (fiber !== hydrationParentFiber) { |
| 12467 | // We're deeper than the current hydration context, inside an inserted |
| 12468 | // tree. |
| 12469 | return false; |
| 12470 | } |
| 12471 | if (!isHydrating) { |
| 12472 | // If we're not currently hydrating but we're in a hydration context, then |
| 12473 | // we were an insertion and now need to pop up reenter hydration of our |
| 12474 | // siblings. |
| 12475 | popToNextHostParent(fiber); |
| 12476 | isHydrating = true; |
| 12477 | return false; |
| 12478 | } |
| 12479 | |
| 12480 | var type = fiber.type; |
| 12481 | |
| 12482 | // If we have any remaining hydratable nodes, we need to delete them now. |
| 12483 | // We only do this deeper than head and body since they tend to have random |
| 12484 | // other nodes in them. We also ignore components with pure text content in |
| 12485 | // side of them. |
| 12486 | // TODO: Better heuristic. |
| 12487 | if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { |
| 12488 | var nextInstance = nextHydratableInstance; |
| 12489 | while (nextInstance) { |
| 12490 | deleteHydratableInstance(fiber, nextInstance); |
| 12491 | nextInstance = getNextHydratableSibling(nextInstance); |
| 12492 | } |
| 12493 | } |
| 12494 | |
| 12495 | popToNextHostParent(fiber); |
| 12496 | nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; |
| 12497 | return true; |
| 12498 | } |
| 12499 | |
| 12500 | function resetHydrationState() { |
| 12501 | hydrationParentFiber = null; |
no test coverage detected