(fiber)
| 12376 | } |
| 12377 | |
| 12378 | function tryToClaimNextHydratableInstance(fiber) { |
| 12379 | if (!isHydrating) { |
| 12380 | return; |
| 12381 | } |
| 12382 | var nextInstance = nextHydratableInstance; |
| 12383 | if (!nextInstance) { |
| 12384 | // Nothing to hydrate. Make it an insertion. |
| 12385 | insertNonHydratedInstance(hydrationParentFiber, fiber); |
| 12386 | isHydrating = false; |
| 12387 | hydrationParentFiber = fiber; |
| 12388 | return; |
| 12389 | } |
| 12390 | if (!tryHydrate(fiber, nextInstance)) { |
| 12391 | // If we can't hydrate this instance let's try the next one. |
| 12392 | // We use this as a heuristic. It's based on intuition and not data so it |
| 12393 | // might be flawed or unnecessary. |
| 12394 | nextInstance = getNextHydratableSibling(nextInstance); |
| 12395 | if (!nextInstance || !tryHydrate(fiber, nextInstance)) { |
| 12396 | // Nothing to hydrate. Make it an insertion. |
| 12397 | insertNonHydratedInstance(hydrationParentFiber, fiber); |
| 12398 | isHydrating = false; |
| 12399 | hydrationParentFiber = fiber; |
| 12400 | return; |
| 12401 | } |
| 12402 | // We matched the next one, we'll now assume that the first one was |
| 12403 | // superfluous and we'll delete it. Since we can't eagerly delete it |
| 12404 | // we'll have to schedule a deletion. To do that, this node needs a dummy |
| 12405 | // fiber associated with it. |
| 12406 | deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); |
| 12407 | } |
| 12408 | hydrationParentFiber = fiber; |
| 12409 | nextHydratableInstance = getFirstHydratableChild(nextInstance); |
| 12410 | } |
| 12411 | |
| 12412 | function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { |
| 12413 | var instance = fiber.stateNode; |
no test coverage detected