Home / File/ FormActionEventPlugin.js — react Source File

FormActionEventPlugin.js — react Source File

Architecture documentation for FormActionEventPlugin.js, a javascript file in the react codebase. 13 imports, 2 dependents.

File javascript BabelCompiler 13 imports 2 dependents

Entity Profile

Dependency Diagram

graph LR
  fa31fc00_cb0d_ab89_d37c_e55788d531b6["FormActionEventPlugin.js"]
  441cc620_4cb4_9cec_2f7a_93b0594f4707["PluginModuleType.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 441cc620_4cb4_9cec_2f7a_93b0594f4707
  4e9925e9_ca97_8d79_6ffa_a9347d262615["DOMEventNames.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 4e9925e9_ca97_8d79_6ffa_a9347d262615
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 816b54e5_c63c_f8b2_68e8_0c637e281f03
  e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c["EventSystemFlags.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> e8ab76a4_05c2_cc4f_1bc2_aec96b5daa8c
  799a7834_f34c_8596_4026_015681eee732["ReactDOMComponentTree.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 799a7834_f34c_8596_4026_015681eee732
  9c3d71d9_41af_c5e7_cd35_d25bbf6cf606["SyntheticEvent.js"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 9c3d71d9_41af_c5e7_cd35_d25bbf6cf606
  42892443_e223_3da0_aeb9_e1b32a408fb0["ReactInternalTypes"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 42892443_e223_3da0_aeb9_e1b32a408fb0
  62e2fec2_e711_12c4_7d64_849f40199109["ReactDOMFormActions"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 62e2fec2_e711_12c4_7d64_849f40199109
  8344de1b_978c_be0f_eebd_38ccc4962a93["ReactFeatureFlags"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 8344de1b_978c_be0f_eebd_38ccc4962a93
  ddecbf3f_f337_559f_a83b_7d088cc54c15["ReactFiberReconciler"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> ddecbf3f_f337_559f_a83b_7d088cc54c15
  d3a47845_22f2_5b63_e892_9fa90a0e63b6["ReactFiberRootScheduler"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> d3a47845_22f2_5b63_e892_9fa90a0e63b6
  80110c01_355a_d61a_f8cd_e74af8e31c9a["sanitizeURL"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 80110c01_355a_d61a_f8cd_e74af8e31c9a
  0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7["CheckStringCoercion"]
  fa31fc00_cb0d_ab89_d37c_e55788d531b6 --> 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  816b54e5_c63c_f8b2_68e8_0c637e281f03 --> fa31fc00_cb0d_ab89_d37c_e55788d531b6
  2d4946a3_3487_598a_390d_fcf4897abb9b["ReactDOMEventReplaying.js"]
  2d4946a3_3487_598a_390d_fcf4897abb9b --> fa31fc00_cb0d_ab89_d37c_e55788d531b6
  style fa31fc00_cb0d_ab89_d37c_e55788d531b6 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 {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';

import {enableTrustedTypesIntegration} from 'shared/ReactFeatureFlags';
import {getFiberCurrentPropsFromNode} from '../../client/ReactDOMComponentTree';
import {startHostTransition} from 'react-reconciler/src/ReactFiberReconciler';
import {didCurrentEventScheduleTransition} from 'react-reconciler/src/ReactFiberRootScheduler';
import sanitizeURL from 'react-dom-bindings/src/shared/sanitizeURL';
import {checkAttributeStringCoercion} from 'shared/CheckStringCoercion';

import {SyntheticEvent} from '../SyntheticEvent';

function coerceFormActionProp(
  actionProp: mixed,
): string | (FormData => void | Promise<void>) | null {
  // This should match the logic in ReactDOMComponent
  if (
    actionProp == null ||
    typeof actionProp === 'symbol' ||
    typeof actionProp === 'boolean'
  ) {
    return null;
  } else if (typeof actionProp === 'function') {
    return (actionProp: any);
  } else {
    if (__DEV__) {
      checkAttributeStringCoercion(actionProp, 'action');
    }
    return (sanitizeURL(
      enableTrustedTypesIntegration ? actionProp : '' + (actionProp: any),
    ): any);
  }
}

/**
 * This plugin invokes action functions on forms, inputs and buttons if
 * the form doesn't prevent default.
 */
function extractEvents(
  dispatchQueue: DispatchQueue,
  domEventName: DOMEventName,
  maybeTargetInst: null | Fiber,
  nativeEvent: AnyNativeEvent,
  nativeEventTarget: null | EventTarget,
  eventSystemFlags: EventSystemFlags,
  targetContainer: EventTarget,
) {
// ... (125 more lines)

Domain

Dependencies

Frequently Asked Questions

What does FormActionEventPlugin.js do?
FormActionEventPlugin.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does FormActionEventPlugin.js depend on?
FormActionEventPlugin.js imports 13 module(s): CheckStringCoercion, DOMEventNames.js, DOMPluginEventSystem.js, EventSystemFlags.js, PluginModuleType.js, ReactDOMComponentTree.js, ReactDOMFormActions, ReactFeatureFlags, and 5 more.
What files import FormActionEventPlugin.js?
FormActionEventPlugin.js is imported by 2 file(s): DOMPluginEventSystem.js, ReactDOMEventReplaying.js.
Where is FormActionEventPlugin.js in the architecture?
FormActionEventPlugin.js is located at packages/react-dom-bindings/src/events/plugins/FormActionEventPlugin.js (domain: BabelCompiler, 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