Home / Function/ getParent() — react Function Reference

getParent() — react Function Reference

Architecture documentation for the getParent() function in ReactNativeBridgeEventPlugin.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  05adccd6_7f72_1322_bc6c_829569eff650["getParent()"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73["ReactNativeBridgeEventPlugin.js"]
  05adccd6_7f72_1322_bc6c_829569eff650 -->|defined in| 577670f6_1f7f_5e0d_b9b6_894b69a76a73
  c0fd4441_582d_b3d2_1619_4ca08804970a["traverseTwoPhase()"]
  c0fd4441_582d_b3d2_1619_4ca08804970a -->|calls| 05adccd6_7f72_1322_bc6c_829569eff650
  style 05adccd6_7f72_1322_bc6c_829569eff650 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js lines 56–69

function getParent(inst) {
  do {
    inst = inst.return;
    // TODO: If this is a HostRoot we might want to bail out.
    // That is depending on if we want nested subtrees (layers) to bubble
    // events to their parent. We could also go through parentNode on the
    // host node but that wouldn't work for React Native and doesn't let us
    // do the portal feature.
  } while (inst && inst.tag !== HostComponent);
  if (inst) {
    return inst;
  }
  return null;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getParent() do?
getParent() is a function in the react codebase, defined in packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js.
Where is getParent() defined?
getParent() is defined in packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js at line 56.
What calls getParent()?
getParent() is called by 1 function(s): traverseTwoPhase.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free