Home / File/ ReactNativeBridgeEventPlugin.js — react Source File

ReactNativeBridgeEventPlugin.js — react Source File

Architecture documentation for ReactNativeBridgeEventPlugin.js, a javascript file in the react codebase. 10 imports, 1 dependents.

File javascript BabelCompiler Validation 10 imports 1 dependents 10 functions

Entity Profile

Dependency Diagram

graph LR
  577670f6_1f7f_5e0d_b9b6_894b69a76a73["ReactNativeBridgeEventPlugin.js"]
  e7f91ff9_eaf6_39c4_5463_6f4e0e1c075f["PluginModuleType.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> e7f91ff9_eaf6_39c4_5463_6f4e0e1c075f
  304edd67_bb4f_7b82_bbee_3b770742ef97["TopLevelEventTypes.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> 304edd67_bb4f_7b82_bbee_3b770742ef97
  a47c9419_7313_73d9_a24c_401cd8fd59b8["SyntheticEvent.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> a47c9419_7313_73d9_a24c_401cd8fd59b8
  a239bd27_5f3a_5675_1ae9_280a089300cf["SyntheticEvent"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> a239bd27_5f3a_5675_1ae9_280a089300cf
  c55ef19d_ffff_0be0_ac25_e6d6c8520cd6["accumulateInto.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> c55ef19d_ffff_0be0_ac25_e6d6c8520cd6
  5f61475e_65e9_53ee_1eeb_f357a8fb2b93["ReactNativeGetListener.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> 5f61475e_65e9_53ee_1eeb_f357a8fb2b93
  2d91c4ed_9a58_6013_5118_49d8f98f9453["getListener"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> 2d91c4ed_9a58_6013_5118_49d8f98f9453
  03d71d90_7e04_8406_8321_a1aeecb7fa15["forEachAccumulated.js"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> 03d71d90_7e04_8406_8321_a1aeecb7fa15
  94a68304_3047_524d_e604_af34f5a80eaf["ReactNativePrivateInterface"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> 94a68304_3047_524d_e604_af34f5a80eaf
  f8f61929_42ba_4030_bc4f_a1c5484f5f32["ReactWorkTags"]
  577670f6_1f7f_5e0d_b9b6_894b69a76a73 --> f8f61929_42ba_4030_bc4f_a1c5484f5f32
  f7a9d9bb_c840_a894_8211_44aed0d8bb24["ReactNativeInjectionShared.js"]
  f7a9d9bb_c840_a894_8211_44aed0d8bb24 --> 577670f6_1f7f_5e0d_b9b6_894b69a76a73
  style 577670f6_1f7f_5e0d_b9b6_894b69a76a73 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import type {
  AnyNativeEvent,
  EventTypes,
  LegacyPluginModule,
} from './legacy-events/PluginModuleType';
import type {TopLevelType} from './legacy-events/TopLevelEventTypes';
import SyntheticEvent from './legacy-events/SyntheticEvent';

// Module provided by RN:
import {ReactNativeViewConfigRegistry} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
import accumulateInto from './legacy-events/accumulateInto';
import getListener from './ReactNativeGetListener';
import forEachAccumulated from './legacy-events/forEachAccumulated';
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';

const {customBubblingEventTypes, customDirectEventTypes} =
  ReactNativeViewConfigRegistry;

// Start of inline: the below functions were inlined from
// EventPropagator.js, as they deviated from ReactDOM's newer
// implementations.
// $FlowFixMe[missing-local-annot]
function listenerAtPhase(inst, event, propagationPhase: PropagationPhases) {
  const registrationName =
    event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  return getListener(inst, registrationName);
}

// $FlowFixMe[missing-local-annot]
function accumulateDirectionalDispatches(inst, phase, event) {
  if (__DEV__) {
    if (!inst) {
      console.error('Dispatching inst must not be null');
    }
  }
  const listener = listenerAtPhase(inst, event, phase);
  if (listener) {
    event._dispatchListeners = accumulateInto(
      event._dispatchListeners,
      listener,
    );
    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  }
}

// $FlowFixMe[missing-local-annot]
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
// ... (158 more lines)

Domain

Subdomains

Frequently Asked Questions

What does ReactNativeBridgeEventPlugin.js do?
ReactNativeBridgeEventPlugin.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactNativeBridgeEventPlugin.js?
ReactNativeBridgeEventPlugin.js defines 10 function(s): accumulateCapturePhaseDispatches, accumulateDirectDispatches, accumulateDirectDispatchesSingle, accumulateDirectionalDispatches, accumulateDispatches, accumulateTwoPhaseDispatches, accumulateTwoPhaseDispatchesSingle, getParent, listenerAtPhase, traverseTwoPhase.
What does ReactNativeBridgeEventPlugin.js depend on?
ReactNativeBridgeEventPlugin.js imports 10 module(s): PluginModuleType.js, ReactNativeGetListener.js, ReactNativePrivateInterface, ReactWorkTags, SyntheticEvent, SyntheticEvent.js, TopLevelEventTypes.js, accumulateInto.js, and 2 more.
What files import ReactNativeBridgeEventPlugin.js?
ReactNativeBridgeEventPlugin.js is imported by 1 file(s): ReactNativeInjectionShared.js.
Where is ReactNativeBridgeEventPlugin.js in the architecture?
ReactNativeBridgeEventPlugin.js is located at packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-native-renderer/src).

Analyze Your Own Codebase

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

Try Supermodel Free