Home / File/ ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js — react Source File

ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js — react Source File

Architecture documentation for ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js, a javascript file in the react codebase.

File javascript BabelCompiler Validation 2 functions 5 classes

Entity Profile

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.
 *
 * @emails react-core
 * @jest-environment ./scripts/jest/ReactDOMServerIntegrationEnvironment
 */

'use strict';

const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegrationTestUtils');

let React;
let ReactDOMClient;
let ReactFeatureFlags;
let ReactDOMServer;

function initModules() {
  // Reset warning cache.
  jest.resetModules();
  React = require('react');
  ReactDOMClient = require('react-dom/client');
  ReactDOMServer = require('react-dom/server');

  ReactFeatureFlags = require('shared/ReactFeatureFlags');
  ReactFeatureFlags.disableLegacyContext = true;

  // Make them available to the helpers.
  return {
    ReactDOMClient,
    ReactDOMServer,
  };
}

const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules);

function formatValue(val) {
  if (val === null) {
    return 'null';
  }
  if (val === undefined) {
    return 'undefined';
  }
  if (typeof val === 'string') {
    return val;
  }
  return JSON.stringify(val);
}

describe('ReactDOMServerIntegrationLegacyContextDisabled', () => {
  beforeEach(() => {
    resetModules();
  });

  itRenders('undefined legacy context with warning', async render => {
    class LegacyProvider extends React.Component {
      static childContextTypes = {
        foo() {},
// ... (107 more lines)

Domain

Subdomains

Frequently Asked Questions

What does ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js do?
ReactDOMServerIntegrationLegacyContextDisabled-test.internal.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 ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js?
ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js defines 2 function(s): formatValue, initModules.
Where is ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js in the architecture?
ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js is located at packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom/src/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free