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

Function isFiberMountedImpl

code/one-direction-data-flow/public/app.js:4988–5015  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

4986var UNMOUNTED = 3;
4987
4988function isFiberMountedImpl(fiber) {
4989 var node = fiber;
4990 if (!fiber.alternate) {
4991 // If there is no alternate, this might be a new tree that isn't inserted
4992 // yet. If it is, then it will have a pending insertion effect on it.
4993 if ((node.effectTag & Placement) !== NoEffect) {
4994 return MOUNTING;
4995 }
4996 while (node['return']) {
4997 node = node['return'];
4998 if ((node.effectTag & Placement) !== NoEffect) {
4999 return MOUNTING;
5000 }
5001 }
5002 } else {
5003 while (node['return']) {
5004 node = node['return'];
5005 }
5006 }
5007 if (node.tag === HostRoot) {
5008 // TODO: Check if this was a nested HostRoot when used with
5009 // renderContainerIntoSubtree.
5010 return MOUNTED;
5011 }
5012 // If we didn't hit the root, that means that we're in an disconnected tree
5013 // that has been unmounted.
5014 return UNMOUNTED;
5015}
5016
5017function isFiberMounted(fiber) {
5018 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