MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / tryHydrate

Function tryHydrate

code/redux/public/app.js:12350–12376  ·  view source on GitHub ↗
(fiber, nextInstance)

Source from the content-addressed store, hash-verified

12348 }
12349
12350 function tryHydrate(fiber, nextInstance) {
12351 switch (fiber.tag) {
12352 case HostComponent:
12353 {
12354 var type = fiber.type;
12355 var props = fiber.pendingProps;
12356 var instance = canHydrateInstance(nextInstance, type, props);
12357 if (instance !== null) {
12358 fiber.stateNode = instance;
12359 return true;
12360 }
12361 return false;
12362 }
12363 case HostText:
12364 {
12365 var text = fiber.pendingProps;
12366 var textInstance = canHydrateTextInstance(nextInstance, text);
12367 if (textInstance !== null) {
12368 fiber.stateNode = textInstance;
12369 return true;
12370 }
12371 return false;
12372 }
12373 default:
12374 return false;
12375 }
12376 }
12377
12378 function tryToClaimNextHydratableInstance(fiber) {
12379 if (!isHydrating) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected