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

Function isFiberMountedImpl

code/redux/public/app.js:5366–5393  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

5364var UNMOUNTED = 3;
5365
5366function isFiberMountedImpl(fiber) {
5367 var node = fiber;
5368 if (!fiber.alternate) {
5369 // If there is no alternate, this might be a new tree that isn't inserted
5370 // yet. If it is, then it will have a pending insertion effect on it.
5371 if ((node.effectTag & Placement) !== NoEffect) {
5372 return MOUNTING;
5373 }
5374 while (node['return']) {
5375 node = node['return'];
5376 if ((node.effectTag & Placement) !== NoEffect) {
5377 return MOUNTING;
5378 }
5379 }
5380 } else {
5381 while (node['return']) {
5382 node = node['return'];
5383 }
5384 }
5385 if (node.tag === HostRoot) {
5386 // TODO: Check if this was a nested HostRoot when used with
5387 // renderContainerIntoSubtree.
5388 return MOUNTED;
5389 }
5390 // If we didn't hit the root, that means that we're in an disconnected tree
5391 // that has been unmounted.
5392 return UNMOUNTED;
5393}
5394
5395function isFiberMounted(fiber) {
5396 return isFiberMountedImpl(fiber) === MOUNTED;

Callers 4

isFiberMountedFunction · 0.70
isMountedFunction · 0.70
assertIsMountedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected