MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / isFiberMountedImpl

Function isFiberMountedImpl

code/composition/public/app.js:5253–5280  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

5251var UNMOUNTED = 3;
5252
5253function isFiberMountedImpl(fiber) {
5254 var node = fiber;
5255 if (!fiber.alternate) {
5256 // If there is no alternate, this might be a new tree that isn't inserted
5257 // yet. If it is, then it will have a pending insertion effect on it.
5258 if ((node.effectTag & Placement) !== NoEffect) {
5259 return MOUNTING;
5260 }
5261 while (node['return']) {
5262 node = node['return'];
5263 if ((node.effectTag & Placement) !== NoEffect) {
5264 return MOUNTING;
5265 }
5266 }
5267 } else {
5268 while (node['return']) {
5269 node = node['return'];
5270 }
5271 }
5272 if (node.tag === HostRoot) {
5273 // TODO: Check if this was a nested HostRoot when used with
5274 // renderContainerIntoSubtree.
5275 return MOUNTED;
5276 }
5277 // If we didn't hit the root, that means that we're in an disconnected tree
5278 // that has been unmounted.
5279 return UNMOUNTED;
5280}
5281
5282function isFiberMounted(fiber) {
5283 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