Home / Function/ traverseTwoPhase() — react Function Reference

traverseTwoPhase() — react Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js lines 74–97

export function traverseTwoPhase(
  inst: Object,
  fn: Function,
  arg: Function,
  skipBubbling: boolean,
) {
  const path = [];
  while (inst) {
    path.push(inst);
    inst = getParent(inst);
  }
  let i;
  for (i = path.length; i-- > 0; ) {
    fn(path[i], 'captured', arg);
  }
  if (skipBubbling) {
    // Dispatch on target only
    fn(path[0], 'bubbled', arg);
  } else {
    for (i = 0; i < path.length; i++) {
      fn(path[i], 'bubbled', arg);
    }
  }
}

Domain

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free