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

Function getParent

code/communication/public/app.js:2550–2563  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

2548});
2549
2550function getParent(inst) {
2551 do {
2552 inst = inst['return'];
2553 // TODO: If this is a HostRoot we might want to bail out.
2554 // That is depending on if we want nested subtrees (layers) to bubble
2555 // events to their parent. We could also go through parentNode on the
2556 // host node but that wouldn't work for React Native and doesn't let us
2557 // do the portal feature.
2558 } while (inst && inst.tag !== HostComponent);
2559 if (inst) {
2560 return inst;
2561 }
2562 return null;
2563}
2564
2565/**
2566 * 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