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

Function getParent

code/composition/public/app.js:2653–2666  ·  view source on GitHub ↗
(inst)

Source from the content-addressed store, hash-verified

2651});
2652
2653function getParent(inst) {
2654 do {
2655 inst = inst['return'];
2656 // TODO: If this is a HostRoot we might want to bail out.
2657 // That is depending on if we want nested subtrees (layers) to bubble
2658 // events to their parent. We could also go through parentNode on the
2659 // host node but that wouldn't work for React Native and doesn't let us
2660 // do the portal feature.
2661 } while (inst && inst.tag !== HostComponent);
2662 if (inst) {
2663 return inst;
2664 }
2665 return null;
2666}
2667
2668/**
2669 * 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