Home / File/ ReactDOMClient.js — react Source File

ReactDOMClient.js — react Source File

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

Entity Profile

Dependency Diagram

graph LR
  6db398ba_1559_798d_f5b5_83b2f71ec02b["ReactDOMClient.js"]
  9a693e56_7137_1e20_368b_4019dde60238["ReactDOMRoot.js"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> 9a693e56_7137_1e20_368b_4019dde60238
  fbf4b833_61f4_4635_7878_2b32dd45eef3["ensureCorrectIsomorphicReactVersion.js"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> fbf4b833_61f4_4635_7878_2b32dd45eef3
  e37db8d5_c1fd_9269_069f_956f9fbcc8a7["ensureCorrectIsomorphicReactVersion"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> e37db8d5_c1fd_9269_069f_956f9fbcc8a7
  ddecbf3f_f337_559f_a83b_7d088cc54c15["ReactFiberReconciler"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> ddecbf3f_f337_559f_a83b_7d088cc54c15
  de79e1ff_cd82_893f_4de4_c543c7303310["ExecutionEnvironment"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> de79e1ff_cd82_893f_4de4_c543c7303310
  0b5d77d6_fa00_515b_1198_0f2d2642dc21["ReactVersion"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> 0b5d77d6_fa00_515b_1198_0f2d2642dc21
  9b61bdad_4620_0f90_ab09_c1efd8c52c41["ReactDOMSharedInternals"]
  6db398ba_1559_798d_f5b5_83b2f71ec02b --> 9b61bdad_4620_0f90_ab09_c1efd8c52c41
  style 6db398ba_1559_798d_f5b5_83b2f71ec02b 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 {createRoot, hydrateRoot} from './ReactDOMRoot';

import {
  injectIntoDevTools,
  findHostInstance,
} from 'react-reconciler/src/ReactFiberReconciler';
import {canUseDOM} from 'shared/ExecutionEnvironment';
import ReactVersion from 'shared/ReactVersion';

import Internals from 'shared/ReactDOMSharedInternals';

import {ensureCorrectIsomorphicReactVersion} from '../shared/ensureCorrectIsomorphicReactVersion';
ensureCorrectIsomorphicReactVersion();

if (__DEV__) {
  if (
    typeof Map !== 'function' ||
    // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype
    Map.prototype == null ||
    typeof Map.prototype.forEach !== 'function' ||
    typeof Set !== 'function' ||
    // $FlowFixMe[prop-missing] Flow incorrectly thinks Set has no prototype
    Set.prototype == null ||
    typeof Set.prototype.clear !== 'function' ||
    typeof Set.prototype.forEach !== 'function'
  ) {
    console.error(
      'React depends on Map and Set built-in types. Make sure that you load a ' +
        'polyfill in older browsers. https://react.dev/link/react-polyfills',
    );
  }
}

function findDOMNode(
  componentOrElement: component(...props: any),
): null | Element | Text {
  return findHostInstance(componentOrElement);
}

// Expose findDOMNode on internals
Internals.findDOMNode = findDOMNode;

export {ReactVersion as version, createRoot, hydrateRoot};

const foundDevTools = injectIntoDevTools();

if (__DEV__) {
  if (!foundDevTools && canUseDOM && window.top === window.self) {
    // If we're in Chrome or Firefox, provide a download link if not installed.
    if (
      (navigator.userAgent.indexOf('Chrome') > -1 &&
        navigator.userAgent.indexOf('Edge') === -1) ||
      navigator.userAgent.indexOf('Firefox') > -1
    ) {
      const protocol = window.location.protocol;
      // Don't warn in exotic cases like chrome-extension://.
      if (/^(https?|file):$/.test(protocol)) {
        // eslint-disable-next-line react-internal/no-production-logging
        console.info(
          '%cDownload the React DevTools ' +
            'for a better development experience: ' +
            'https://react.dev/link/react-devtools' +
            (protocol === 'file:'
              ? '\nYou might need to use a local HTTP server (instead of file://): ' +
                'https://react.dev/link/react-devtools-faq'
              : ''),
          'font-weight:bold',
        );
      }
    }
  }
}

Domain

Dependencies

Frequently Asked Questions

What does ReactDOMClient.js do?
ReactDOMClient.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactDOMClient.js depend on?
ReactDOMClient.js imports 7 module(s): ExecutionEnvironment, ReactDOMRoot.js, ReactDOMSharedInternals, ReactFiberReconciler, ReactVersion, ensureCorrectIsomorphicReactVersion, ensureCorrectIsomorphicReactVersion.js.
Where is ReactDOMClient.js in the architecture?
ReactDOMClient.js is located at packages/react-dom/src/client/ReactDOMClient.js (domain: BabelCompiler, directory: packages/react-dom/src/client).

Analyze Your Own Codebase

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

Try Supermodel Free