Home / Function/ mockReact() — react Function Reference

mockReact() — react Function Reference

Architecture documentation for the mockReact() function in setupHostConfigs.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  df842ecf_3d7b_4568_2964_a761aa5d1253["mockReact()"]
  453c2a4b_eadd_4b72_cc97_406b0eb158f2["setupHostConfigs.js"]
  df842ecf_3d7b_4568_2964_a761aa5d1253 -->|defined in| 453c2a4b_eadd_4b72_cc97_406b0eb158f2
  a3133ba3_09e4_b4bd_0635_cc4de0d786d4["resolveEntryFork()"]
  df842ecf_3d7b_4568_2964_a761aa5d1253 -->|calls| a3133ba3_09e4_b4bd_0635_cc4de0d786d4
  style df842ecf_3d7b_4568_2964_a761aa5d1253 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/jest/setupHostConfigs.js lines 101–115

function mockReact() {
  jest.mock('react', () => {
    const resolvedEntryPoint = resolveEntryFork(
      require.resolve('react'),
      global.__WWW__ || global.__XPLAT__,
      global.__DEV__
    );
    return jest.requireActual(resolvedEntryPoint);
  });
  // Make it possible to import this module inside
  // the React package itself.
  jest.mock('shared/ReactSharedInternals', () => {
    return jest.requireActual('react/src/ReactSharedInternalsClient');
  });
}

Domain

Subdomains

Frequently Asked Questions

What does mockReact() do?
mockReact() is a function in the react codebase, defined in scripts/jest/setupHostConfigs.js.
Where is mockReact() defined?
mockReact() is defined in scripts/jest/setupHostConfigs.js at line 101.
What does mockReact() call?
mockReact() calls 1 function(s): resolveEntryFork.

Analyze Your Own Codebase

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

Try Supermodel Free