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

Function getParent

code/one-direction-data-flow/public/app.js:2388–2401  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

2386});
2387
2388function getParent(inst) {
2389 do {
2390 inst = inst['return'];
2391 // TODO: If this is a HostRoot we might want to bail out.
2392 // That is depending on if we want nested subtrees (layers) to bubble
2393 // events to their parent. We could also go through parentNode on the
2394 // host node but that wouldn't work for React Native and doesn't let us
2395 // do the portal feature.
2396 } while (inst && inst.tag !== HostComponent);
2397 if (inst) {
2398 return inst;
2399 }
2400 return null;
2401}
2402
2403/**
2404 * Return the lowest common ancestor of A and B, or null if they are in

Callers 4

getLowestCommonAncestorFunction · 0.70
getParentInstanceFunction · 0.70
traverseTwoPhaseFunction · 0.70
traverseEnterLeaveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected