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

Function getParent

code/styling/public/app.js:2515–2528  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

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