Home / File/ ChangeEventPlugin.js — react Source File

ChangeEventPlugin.js — react Source File

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

File javascript BabelCompiler Validation 30 imports 1 dependents 7 functions

Entity Profile

Dependency Diagram

graph LR
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7["ChangeEventPlugin.js"]
  9c694103_7f39_88d0_6b4d_f9b2ffed5731["ReactFiberConfigDOM.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 9c694103_7f39_88d0_6b4d_f9b2ffed5731
  441cc620_4cb4_9cec_2f7a_93b0594f4707["PluginModuleType.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 441cc620_4cb4_9cec_2f7a_93b0594f4707
  4e9925e9_ca97_8d79_6ffa_a9347d262615["DOMEventNames.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 4e9925e9_ca97_8d79_6ffa_a9347d262615
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 816b54e5_c63c_f8b2_68e8_0c637e281f03
  e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c["EventSystemFlags.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c
  3632e1a4_9237_b583_7260_c67d392d0405["ReactSyntheticEventType.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 3632e1a4_9237_b583_7260_c67d392d0405
  e1c602b7_5988_fa00_bb9f_269d66d38107["EventRegistry.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> e1c602b7_5988_fa00_bb9f_269d66d38107
  db2a0ac3_1faf_8e02_55e8_f299ce8da5e9["registerTwoPhaseEvent"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> db2a0ac3_1faf_8e02_55e8_f299ce8da5e9
  9c3d71d9_41af_c5e7_cd35_d25bbf6cf606["SyntheticEvent.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 9c3d71d9_41af_c5e7_cd35_d25bbf6cf606
  d1896f19_d30c_0443_48d3_c9e718f95b77["isTextInputElement.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> d1896f19_d30c_0443_48d3_c9e718f95b77
  ad61f88d_874a_73e7_6d93_c79d0d2caa0d["getEventTarget.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> ad61f88d_874a_73e7_6d93_c79d0d2caa0d
  09433e29_bd2e_6733_ed27_363b257bb8e0["getEventTarget"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 09433e29_bd2e_6733_ed27_363b257bb8e0
  c30b243e_ec29_69c6_2af4_f9dbe2733733["isEventSupported.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> c30b243e_ec29_69c6_2af4_f9dbe2733733
  849b528c_c7f4_c2eb_ce7a_1b4cea872d42["isEventSupported"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 849b528c_c7f4_c2eb_ce7a_1b4cea872d42
  style ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 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 {TextInstance, Instance} from '../../client/ReactFiberConfigDOM';
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 {ReactSyntheticEvent} from '../ReactSyntheticEventType';

import {registerTwoPhaseEvent} from '../EventRegistry';
import {SyntheticEvent} from '../SyntheticEvent';
import isTextInputElement from '../isTextInputElement';
import {canUseDOM} from 'shared/ExecutionEnvironment';

import getEventTarget from '../getEventTarget';
import isEventSupported from '../isEventSupported';
import {getNodeFromInstance} from '../../client/ReactDOMComponentTree';
import {updateValueIfChanged} from '../../client/inputValueTracking';
import {setDefaultValue} from '../../client/ReactDOMInput';
import {enqueueStateRestore} from '../ReactDOMControlledComponent';

import {disableInputAttributeSyncing} from 'shared/ReactFeatureFlags';
import {batchedUpdates} from '../ReactDOMUpdateBatching';
import {
  processDispatchQueue,
  accumulateTwoPhaseListeners,
} from '../DOMPluginEventSystem';
import isCustomElement from '../../shared/isCustomElement';

function registerEvents() {
  registerTwoPhaseEvent('onChange', [
    'change',
    'click',
    'focusin',
    'focusout',
    'input',
    'keydown',
    'keyup',
    'selectionchange',
  ]);
}

function createAndAccumulateChangeEvent(
  dispatchQueue: DispatchQueue,
  inst: null | Fiber,
  nativeEvent: AnyNativeEvent,
  target: null | EventTarget,
) {
  // Flag this event loop as needing state restore.
  enqueueStateRestore(((target: any): Node));
  const listeners = accumulateTwoPhaseListeners(inst, 'onChange');
  if (listeners.length > 0) {
    const event: ReactSyntheticEvent = new SyntheticEvent(
// ... (285 more lines)

Domain

Subdomains

Frequently Asked Questions

What does ChangeEventPlugin.js do?
ChangeEventPlugin.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 ChangeEventPlugin.js?
ChangeEventPlugin.js defines 7 function(s): createAndAccumulateChangeEvent, getInstIfValueChanged, getTargetInstForChangeEvent, manualDispatchChangeEvent, registerEvents, runEventInBatch, shouldUseChangeEvent.
What does ChangeEventPlugin.js depend on?
ChangeEventPlugin.js imports 30 module(s): DOMEventNames.js, DOMPluginEventSystem.js, EventRegistry.js, EventSystemFlags.js, ExecutionEnvironment, PluginModuleType.js, ReactDOMComponentTree.js, ReactDOMControlledComponent.js, and 22 more.
What files import ChangeEventPlugin.js?
ChangeEventPlugin.js is imported by 1 file(s): DOMPluginEventSystem.js.
Where is ChangeEventPlugin.js in the architecture?
ChangeEventPlugin.js is located at packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.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