Home / Function/ forks../packages/shared/ReactSharedInternals.js() — react Function Reference

forks../packages/shared/ReactSharedInternals.js() — react Function Reference

Architecture documentation for the forks../packages/shared/ReactSharedInternals.js() function in forks.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1f9891ae_87bb_d349_22d2_208c52caacaa["forks../packages/shared/ReactSharedInternals.js()"]
  b3630029_765f_b687_a690_e54190fd7201["forks.js"]
  1f9891ae_87bb_d349_22d2_208c52caacaa -->|defined in| b3630029_765f_b687_a690_e54190fd7201
  style 1f9891ae_87bb_d349_22d2_208c52caacaa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/forks.js lines 55–89

  './packages/shared/ReactSharedInternals.js': (
    bundleType,
    entry,
    dependencies,
    _moduleType,
    bundle
  ) => {
    if (entry === 'react') {
      return './packages/react/src/ReactSharedInternalsClient.js';
    }
    if (entry === 'react/src/ReactServer.js') {
      return './packages/react/src/ReactSharedInternalsServer.js';
    }
    if (entry === 'react-markup/src/ReactMarkupServer.js') {
      // Inside the ReactMarkupServer render we don't refer to any shared internals
      // but instead use our own internal copy of the state because you cannot use
      // any of this state from a component anyway. E.g. you can't use a client hook.
      return './packages/react/src/ReactSharedInternalsClient.js';
    }
    if (bundle.condition === 'react-server') {
      return './packages/react-server/src/ReactSharedInternalsServer.js';
    }
    if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
      // React internals are unavailable if we can't reference the package.
      // We return an error because we only want to throw if this module gets used.
      return new Error(
        'Cannot use a module that depends on ReactSharedInternals ' +
          'from "' +
          entry +
          '" because it does not declare "react" in the package ' +
          'dependencies or peerDependencies.'
      );
    }
    return null;
  },

Domain

Subdomains

Frequently Asked Questions

What does forks../packages/shared/ReactSharedInternals.js() do?
forks../packages/shared/ReactSharedInternals.js() is a function in the react codebase, defined in scripts/rollup/forks.js.
Where is forks../packages/shared/ReactSharedInternals.js() defined?
forks../packages/shared/ReactSharedInternals.js() is defined in scripts/rollup/forks.js at line 55.

Analyze Your Own Codebase

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

Try Supermodel Free