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

Function getParent

code/higher-order-components/public/app.js:2509–2522  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

2507});
2508
2509function getParent(inst) {
2510 do {
2511 inst = inst['return'];
2512 // TODO: If this is a HostRoot we might want to bail out.
2513 // That is depending on if we want nested subtrees (layers) to bubble
2514 // events to their parent. We could also go through parentNode on the
2515 // host node but that wouldn't work for React Native and doesn't let us
2516 // do the portal feature.
2517 } while (inst && inst.tag !== HostComponent);
2518 if (inst) {
2519 return inst;
2520 }
2521 return null;
2522}
2523
2524/**
2525 * 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