Home / File/ getActiveElement.js — react Source File

getActiveElement.js — react Source File

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

File javascript BabelCompiler Validation 3 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  fa8c5082_5952_1b00_ab76_4bbec8487a1d["getActiveElement.js"]
  ebd36fdb_cc70_52b6_9971_bcace1958602["ReactDOMInput.js"]
  ebd36fdb_cc70_52b6_9971_bcace1958602 --> fa8c5082_5952_1b00_ab76_4bbec8487a1d
  61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5["ReactInputSelection.js"]
  61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5 --> fa8c5082_5952_1b00_ab76_4bbec8487a1d
  b8a5c95d_02fb_4719_0efd_4463f2546996["SelectEventPlugin.js"]
  b8a5c95d_02fb_4719_0efd_4463f2546996 --> fa8c5082_5952_1b00_ab76_4bbec8487a1d
  style fa8c5082_5952_1b00_ab76_4bbec8487a1d 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
 */

export default function getActiveElement(doc: ?Document): ?Element {
  doc = doc || (typeof document !== 'undefined' ? document : undefined);
  if (typeof doc === 'undefined') {
    return null;
  }
  try {
    return doc.activeElement || doc.body;
  } catch (e) {
    return doc.body;
  }
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does getActiveElement.js do?
getActiveElement.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 getActiveElement.js?
getActiveElement.js defines 1 function(s): getActiveElement.
What files import getActiveElement.js?
getActiveElement.js is imported by 3 file(s): ReactDOMInput.js, ReactInputSelection.js, SelectEventPlugin.js.
Where is getActiveElement.js in the architecture?
getActiveElement.js is located at packages/react-dom-bindings/src/client/getActiveElement.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/client).

Analyze Your Own Codebase

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

Try Supermodel Free