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

Function ReactFiberHydrationContext

code/third-party/public/app.js:11203–11496  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

11201};
11202
11203var ReactFiberHydrationContext = function (config) {
11204 var shouldSetTextContent = config.shouldSetTextContent,
11205 hydration = config.hydration;
11206
11207 // If this doesn't have hydration mode.
11208
11209 if (!hydration) {
11210 return {
11211 enterHydrationState: function () {
11212 return false;
11213 },
11214 resetHydrationState: function () {},
11215 tryToClaimNextHydratableInstance: function () {},
11216 prepareToHydrateHostInstance: function () {
11217 invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
11218 },
11219 prepareToHydrateHostTextInstance: function () {
11220 invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
11221 },
11222 popHydrationState: function (fiber) {
11223 return false;
11224 }
11225 };
11226 }
11227
11228 var canHydrateInstance = hydration.canHydrateInstance,
11229 canHydrateTextInstance = hydration.canHydrateTextInstance,
11230 getNextHydratableSibling = hydration.getNextHydratableSibling,
11231 getFirstHydratableChild = hydration.getFirstHydratableChild,
11232 hydrateInstance = hydration.hydrateInstance,
11233 hydrateTextInstance = hydration.hydrateTextInstance,
11234 didNotMatchHydratedContainerTextInstance = hydration.didNotMatchHydratedContainerTextInstance,
11235 didNotMatchHydratedTextInstance = hydration.didNotMatchHydratedTextInstance,
11236 didNotHydrateContainerInstance = hydration.didNotHydrateContainerInstance,
11237 didNotHydrateInstance = hydration.didNotHydrateInstance,
11238 didNotFindHydratableContainerInstance = hydration.didNotFindHydratableContainerInstance,
11239 didNotFindHydratableContainerTextInstance = hydration.didNotFindHydratableContainerTextInstance,
11240 didNotFindHydratableInstance = hydration.didNotFindHydratableInstance,
11241 didNotFindHydratableTextInstance = hydration.didNotFindHydratableTextInstance;
11242
11243 // The deepest Fiber on the stack involved in a hydration context.
11244 // This may have been an insertion or a hydration.
11245
11246 var hydrationParentFiber = null;
11247 var nextHydratableInstance = null;
11248 var isHydrating = false;
11249
11250 function enterHydrationState(fiber) {
11251 var parentInstance = fiber.stateNode.containerInfo;
11252 nextHydratableInstance = getFirstHydratableChild(parentInstance);
11253 hydrationParentFiber = fiber;
11254 isHydrating = true;
11255 return true;
11256 }
11257
11258 function deleteHydratableInstance(returnFiber, instance) {
11259 {
11260 switch (returnFiber.tag) {

Callers 1

ReactFiberSchedulerFunction · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected