Home / File/ ReactDOMFloat.js — react Source File

ReactDOMFloat.js — react Source File

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

File javascript BabelCompiler Validation 3 imports 1 dependents 8 functions

Entity Profile

Dependency Diagram

graph LR
  3ea12e77_bd9c_ec2a_fb3c_db692f520137["ReactDOMFloat.js"]
  a4b0922c_f703_f99d_9884_88c43f8f2825["ReactDOMTypes.js"]
  3ea12e77_bd9c_ec2a_fb3c_db692f520137 --> a4b0922c_f703_f99d_9884_88c43f8f2825
  9b61bdad_4620_0f90_ab09_c1efd8c52c41["ReactDOMSharedInternals"]
  3ea12e77_bd9c_ec2a_fb3c_db692f520137 --> 9b61bdad_4620_0f90_ab09_c1efd8c52c41
  b820acb1_65c7_d72b_43c6_ac0de9981a56["crossOriginStrings"]
  3ea12e77_bd9c_ec2a_fb3c_db692f520137 --> b820acb1_65c7_d72b_43c6_ac0de9981a56
  ca23127c_62b0_2c69_7293_39d92b24a5c0["ReactDOM.js"]
  ca23127c_62b0_2c69_7293_39d92b24a5c0 --> 3ea12e77_bd9c_ec2a_fb3c_db692f520137
  style 3ea12e77_bd9c_ec2a_fb3c_db692f520137 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 {
  PreconnectOptions,
  PreloadOptions,
  PreloadModuleOptions,
  PreinitOptions,
  PreinitModuleOptions,
} from './ReactDOMTypes';

import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals';

import {
  getCrossOriginString,
  getCrossOriginStringAs,
} from 'react-dom-bindings/src/shared/crossOriginStrings';

export function prefetchDNS(href: string) {
  if (__DEV__) {
    if (typeof href !== 'string' || !href) {
      console.error(
        'ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.',
        getValueDescriptorExpectingObjectForWarning(href),
      );
    } else if (arguments.length > 1) {
      const options = arguments[1];
      if (
        typeof options === 'object' &&
        options.hasOwnProperty('crossOrigin')
      ) {
        console.error(
          'ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.',
          getValueDescriptorExpectingEnumForWarning(options),
        );
      } else {
        console.error(
          'ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.',
          getValueDescriptorExpectingEnumForWarning(options),
        );
      }
    }
  }
  if (typeof href === 'string') {
    ReactDOMSharedInternals.d /* ReactDOMCurrentDispatcher */
      .D(/* prefetchDNS */ href);
  }
  // We don't error because preconnect needs to be resilient to being called in a variety of scopes
  // and the runtime may not be capable of responding. The function is optimistic and not critical
  // so we favor silent bailout over warning or erroring.
}

export function preconnect(href: string, options?: ?PreconnectOptions) {
  if (__DEV__) {
    if (typeof href !== 'string' || !href) {
// ... (298 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ReactDOMFloat.js do?
ReactDOMFloat.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 ReactDOMFloat.js?
ReactDOMFloat.js defines 8 function(s): getValueDescriptorExpectingEnumForWarning, getValueDescriptorExpectingObjectForWarning, preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule.
What does ReactDOMFloat.js depend on?
ReactDOMFloat.js imports 3 module(s): ReactDOMSharedInternals, ReactDOMTypes.js, crossOriginStrings.
What files import ReactDOMFloat.js?
ReactDOMFloat.js is imported by 1 file(s): ReactDOM.js.
Where is ReactDOMFloat.js in the architecture?
ReactDOMFloat.js is located at packages/react-dom/src/shared/ReactDOMFloat.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom/src/shared).

Analyze Your Own Codebase

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

Try Supermodel Free