MCPcopy Index your code
hub / github.com/caseywebdev/react-list / buildHydrationDiffNode

Function buildHydrationDiffNode

docs/index.js:22764–22804  ·  view source on GitHub ↗
(fiber, distanceFromLeaf)

Source from the content-addressed store, hash-verified

22762 );
22763 }
22764 function buildHydrationDiffNode(fiber, distanceFromLeaf) {
22765 if (null === fiber.return) {
22766 if (null === hydrationDiffRootDEV)
22767 hydrationDiffRootDEV = {
22768 fiber: fiber,
22769 children: [],
22770 serverProps: void 0,
22771 serverTail: [],
22772 distanceFromLeaf: distanceFromLeaf
22773 };
22774 else {
22775 if (hydrationDiffRootDEV.fiber !== fiber)
22776 throw Error(
22777 "Saw multiple hydration diff roots in a pass. This is a bug in React."
22778 );
22779 hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf &&
22780 (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
22781 }
22782 return hydrationDiffRootDEV;
22783 }
22784 var siblings = buildHydrationDiffNode(
22785 fiber.return,
22786 distanceFromLeaf + 1
22787 ).children;
22788 if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
22789 return (
22790 (siblings = siblings[siblings.length - 1]),
22791 siblings.distanceFromLeaf > distanceFromLeaf &&
22792 (siblings.distanceFromLeaf = distanceFromLeaf),
22793 siblings
22794 );
22795 distanceFromLeaf = {
22796 fiber: fiber,
22797 children: [],
22798 serverProps: void 0,
22799 serverTail: [],
22800 distanceFromLeaf: distanceFromLeaf
22801 };
22802 siblings.push(distanceFromLeaf);
22803 return distanceFromLeaf;
22804 }
22805 function warnNonHydratedInstance(fiber, rejectedCandidate) {
22806 didSuspendOrErrorDEV ||
22807 ((fiber = buildHydrationDiffNode(fiber, 0)),

Callers 4

warnNonHydratedInstanceFunction · 0.85
popHydrationStateFunction · 0.85
beginWorkFunction · 0.85
completeWorkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…