MCPcopy Create free account
hub / github.com/microsoft/SandDance / getParent

Function getParent

docs/external/js/react-dom.development.js:8084–8098  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

8082 }
8083
8084 function getParent(inst) {
8085 do {
8086 inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
8087 // That is depending on if we want nested subtrees (layers) to bubble
8088 // events to their parent. We could also go through parentNode on the
8089 // host node but that wouldn't work for React Native and doesn't let us
8090 // do the portal feature.
8091 } while (inst && inst.tag !== HostComponent);
8092
8093 if (inst) {
8094 return inst;
8095 }
8096
8097 return null;
8098 }
8099 /**
8100 * Return the lowest common ancestor of A and B, or null if they are in
8101 * different trees.

Callers 3

getLowestCommonAncestorFunction · 0.70
traverseTwoPhaseFunction · 0.70
traverseEnterLeaveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected