ReactDOMServerIntegrationClassContextType-test.js — react Source File
Architecture documentation for ReactDOMServerIntegrationClassContextType-test.js, a javascript file in the react codebase.
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 ReactDOMServer;
function initModules() {
// Reset warning cache.
jest.resetModules();
React = require('react');
ReactDOMClient = require('react-dom/client');
ReactDOMServer = require('react-dom/server');
// Make them available to the helpers.
return {
ReactDOMClient,
ReactDOMServer,
};
}
const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules);
describe('ReactDOMServerIntegration', () => {
beforeEach(() => {
resetModules();
});
describe('class contextType', function () {
let PurpleContext, RedContext, Context;
beforeEach(() => {
Context = React.createContext('none');
class Parent extends React.Component {
render() {
return (
<Context.Provider value={this.props.text}>
{this.props.children}
</Context.Provider>
);
}
}
PurpleContext = props => <Parent text="purple">{props.children}</Parent>;
RedContext = props => <Parent text="red">{props.children}</Parent>;
});
itRenders('class child with context', async render => {
class ClassChildWithContext extends React.Component {
static contextType = Context;
// ... (208 more lines)
Domain
Subdomains
Functions
Classes
Source
Frequently Asked Questions
What does ReactDOMServerIntegrationClassContextType-test.js do?
ReactDOMServerIntegrationClassContextType-test.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 ReactDOMServerIntegrationClassContextType-test.js?
ReactDOMServerIntegrationClassContextType-test.js defines 1 function(s): initModules.
Where is ReactDOMServerIntegrationClassContextType-test.js in the architecture?
ReactDOMServerIntegrationClassContextType-test.js is located at packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.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