Home / File/ CurrentReplayingEvent.js — react Source File

CurrentReplayingEvent.js — react Source File

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

File javascript BabelCompiler Validation 1 imports 3 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  cb8ebc91_809b_31af_5fb0_324ffb570303["CurrentReplayingEvent.js"]
  441cc620_4cb4_9cec_2f7a_93b0594f4707["PluginModuleType.js"]
  cb8ebc91_809b_31af_5fb0_324ffb570303 --> 441cc620_4cb4_9cec_2f7a_93b0594f4707
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  816b54e5_c63c_f8b2_68e8_0c637e281f03 --> cb8ebc91_809b_31af_5fb0_324ffb570303
  2d4946a3_3487_598a_390d_fcf4897abb9b["ReactDOMEventReplaying.js"]
  2d4946a3_3487_598a_390d_fcf4897abb9b --> cb8ebc91_809b_31af_5fb0_324ffb570303
  5c7e27b3_eb27_811d_04b8_b882f63e7494["EnterLeaveEventPlugin.js"]
  5c7e27b3_eb27_811d_04b8_b882f63e7494 --> cb8ebc91_809b_31af_5fb0_324ffb570303
  style cb8ebc91_809b_31af_5fb0_324ffb570303 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 '../events/PluginModuleType';

// This exists to avoid circular dependency between ReactDOMEventReplaying
// and DOMPluginEventSystem.

let currentReplayingEvent = null;

export function setReplayingEvent(event: AnyNativeEvent): void {
  if (__DEV__) {
    if (currentReplayingEvent !== null) {
      console.error(
        'Expected currently replaying event to be null. This error ' +
          'is likely caused by a bug in React. Please file an issue.',
      );
    }
  }
  currentReplayingEvent = event;
}

export function resetReplayingEvent(): void {
  if (__DEV__) {
    if (currentReplayingEvent === null) {
      console.error(
        'Expected currently replaying event to not be null. This error ' +
          'is likely caused by a bug in React. Please file an issue.',
      );
    }
  }
  currentReplayingEvent = null;
}

export function isReplayingEvent(event: AnyNativeEvent): boolean {
  return event === currentReplayingEvent;
}

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does CurrentReplayingEvent.js do?
CurrentReplayingEvent.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 CurrentReplayingEvent.js?
CurrentReplayingEvent.js defines 3 function(s): isReplayingEvent, resetReplayingEvent, setReplayingEvent.
What does CurrentReplayingEvent.js depend on?
CurrentReplayingEvent.js imports 1 module(s): PluginModuleType.js.
What files import CurrentReplayingEvent.js?
CurrentReplayingEvent.js is imported by 3 file(s): DOMPluginEventSystem.js, EnterLeaveEventPlugin.js, ReactDOMEventReplaying.js.
Where is CurrentReplayingEvent.js in the architecture?
CurrentReplayingEvent.js is located at packages/react-dom-bindings/src/events/CurrentReplayingEvent.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/events).

Analyze Your Own Codebase

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

Try Supermodel Free