Home / File/ checkPassiveEvents.js — react Source File

checkPassiveEvents.js — react Source File

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

File javascript BabelCompiler 1 imports 1 dependents

Entity Profile

Dependency Diagram

graph LR
  bdeda43a_0116_ab15_fc56_17fc797a1f01["checkPassiveEvents.js"]
  de79e1ff_cd82_893f_4de4_c543c7303310["ExecutionEnvironment"]
  bdeda43a_0116_ab15_fc56_17fc797a1f01 --> de79e1ff_cd82_893f_4de4_c543c7303310
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  816b54e5_c63c_f8b2_68e8_0c637e281f03 --> bdeda43a_0116_ab15_fc56_17fc797a1f01
  style bdeda43a_0116_ab15_fc56_17fc797a1f01 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 {canUseDOM} from 'shared/ExecutionEnvironment';

export let passiveBrowserEventsSupported: boolean = false;

// Check if browser support events with passive listeners
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
if (canUseDOM) {
  try {
    const options: {
      passive?: void,
    } = {};
    Object.defineProperty(options, 'passive', {
      get: function () {
        passiveBrowserEventsSupported = true;
      },
    });
    window.addEventListener('test', options, options);
    window.removeEventListener('test', options, options);
  } catch (e) {
    passiveBrowserEventsSupported = false;
  }
}

Domain

Dependencies

  • ExecutionEnvironment

Frequently Asked Questions

What does checkPassiveEvents.js do?
checkPassiveEvents.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does checkPassiveEvents.js depend on?
checkPassiveEvents.js imports 1 module(s): ExecutionEnvironment.
What files import checkPassiveEvents.js?
checkPassiveEvents.js is imported by 1 file(s): DOMPluginEventSystem.js.
Where is checkPassiveEvents.js in the architecture?
checkPassiveEvents.js is located at packages/react-dom-bindings/src/events/checkPassiveEvents.js (domain: BabelCompiler, 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