EnterLeaveEventPlugin.js — react Source File
Architecture documentation for EnterLeaveEventPlugin.js, a javascript file in the react codebase. 15 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 5c7e27b3_eb27_811d_04b8_b882f63e7494["EnterLeaveEventPlugin.js"] 441cc620_4cb4_9cec_2f7a_93b0594f4707["PluginModuleType.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 441cc620_4cb4_9cec_2f7a_93b0594f4707 4e9925e9_ca97_8d79_6ffa_a9347d262615["DOMEventNames.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 4e9925e9_ca97_8d79_6ffa_a9347d262615 816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 816b54e5_c63c_f8b2_68e8_0c637e281f03 e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c["EventSystemFlags.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c 3632e1a4_9237_b583_7260_c67d392d0405["ReactSyntheticEventType.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 3632e1a4_9237_b583_7260_c67d392d0405 e1c602b7_5988_fa00_bb9f_269d66d38107["EventRegistry.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> e1c602b7_5988_fa00_bb9f_269d66d38107 bb2a3780_9595_4070_a95b_b136e2d4f7a8["registerDirectEvent"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> bb2a3780_9595_4070_a95b_b136e2d4f7a8 cb8ebc91_809b_31af_5fb0_324ffb570303["CurrentReplayingEvent.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> cb8ebc91_809b_31af_5fb0_324ffb570303 9ea33c9d_8861_07e4_cd82_238384a96c0f["isReplayingEvent"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 9ea33c9d_8861_07e4_cd82_238384a96c0f 9c3d71d9_41af_c5e7_cd35_d25bbf6cf606["SyntheticEvent.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 9c3d71d9_41af_c5e7_cd35_d25bbf6cf606 799a7834_f34c_8596_4026_015681eee732["ReactDOMComponentTree.js"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 799a7834_f34c_8596_4026_015681eee732 fd46bf1d_69db_d76a_fbca_8de451c9f52e["isContainerMarkedAsRoot"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> fd46bf1d_69db_d76a_fbca_8de451c9f52e 42892443_e223_3da0_aeb9_e1b32a408fb0["ReactInternalTypes"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> 42892443_e223_3da0_aeb9_e1b32a408fb0 f8f61929_42ba_4030_bc4f_a1c5484f5f32["ReactWorkTags"] 5c7e27b3_eb27_811d_04b8_b882f63e7494 --> f8f61929_42ba_4030_bc4f_a1c5484f5f32 style 5c7e27b3_eb27_811d_04b8_b882f63e7494 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} from '../PluginModuleType';
import type {DOMEventName} from '../DOMEventNames';
import type {DispatchQueue} from '../DOMPluginEventSystem';
import type {EventSystemFlags} from '../EventSystemFlags';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {KnownReactSyntheticEvent} from '../ReactSyntheticEventType';
import {registerDirectEvent} from '../EventRegistry';
import {isReplayingEvent} from '../CurrentReplayingEvent';
import {SyntheticMouseEvent, SyntheticPointerEvent} from '../SyntheticEvent';
import {
getClosestInstanceFromNode,
getNodeFromInstance,
isContainerMarkedAsRoot,
} from '../../client/ReactDOMComponentTree';
import {accumulateEnterLeaveTwoPhaseListeners} from '../DOMPluginEventSystem';
import {
HostComponent,
HostSingleton,
HostText,
} from 'react-reconciler/src/ReactWorkTags';
import {getNearestMountedFiber} from 'react-reconciler/src/ReactFiberTreeReflection';
function registerEvents() {
registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);
registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);
registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);
registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);
}
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
* we do not extract duplicate events. However, moving the mouse into the
* browser from outside will not fire a `mouseout` event. In this case, we use
* the `mouseover` top-level event.
*/
function extractEvents(
dispatchQueue: DispatchQueue,
domEventName: DOMEventName,
targetInst: null | Fiber,
nativeEvent: AnyNativeEvent,
nativeEventTarget: null | EventTarget,
eventSystemFlags: EventSystemFlags,
targetContainer: EventTarget,
) {
const isOverEvent =
domEventName === 'mouseover' || domEventName === 'pointerover';
const isOutEvent =
domEventName === 'mouseout' || domEventName === 'pointerout';
// ... (114 more lines)
Domain
Subdomains
Functions
Dependencies
Source
Frequently Asked Questions
What does EnterLeaveEventPlugin.js do?
EnterLeaveEventPlugin.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 EnterLeaveEventPlugin.js?
EnterLeaveEventPlugin.js defines 2 function(s): extractEvents, registerEvents.
What does EnterLeaveEventPlugin.js depend on?
EnterLeaveEventPlugin.js imports 15 module(s): CurrentReplayingEvent.js, DOMEventNames.js, DOMPluginEventSystem.js, EventRegistry.js, EventSystemFlags.js, PluginModuleType.js, ReactDOMComponentTree.js, ReactFiberTreeReflection, and 7 more.
What files import EnterLeaveEventPlugin.js?
EnterLeaveEventPlugin.js is imported by 1 file(s): DOMPluginEventSystem.js.
Where is EnterLeaveEventPlugin.js in the architecture?
EnterLeaveEventPlugin.js is located at packages/react-dom-bindings/src/events/plugins/EnterLeaveEventPlugin.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/events/plugins).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free