ReactTypeScriptClass-test.ts — react Source File
Architecture documentation for ReactTypeScriptClass-test.ts, a typescript file in the react codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 3370f447_d44c_9d13_9604_1490287e7bf1["ReactTypeScriptClass-test.ts"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 4d0c4ccc_5970_e7f9_458f_15f0290099b1["react-dom"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> 4d0c4ccc_5970_e7f9_458f_15f0290099b1 8792c1c1_dca5_f137_73ea_c0e268fdbb22["client"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> 8792c1c1_dca5_f137_73ea_c0e268fdbb22 4962a421_6f44_376a_ec35_6032e4845540["prop-types"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> 4962a421_6f44_376a_ec35_6032e4845540 8344de1b_978c_be0f_eebd_38ccc4962a93["ReactFeatureFlags"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> 8344de1b_978c_be0f_eebd_38ccc4962a93 45a3f0b3_f8dc_3285_d2a0_4bf1891177d3["internal-test-utils"] 3370f447_d44c_9d13_9604_1490287e7bf1 --> 45a3f0b3_f8dc_3285_d2a0_4bf1891177d3 style 3370f447_d44c_9d13_9604_1490287e7bf1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/// <reference path="./testDefinitions/PropTypes.d.ts" />
/// <reference path="./testDefinitions/React.d.ts" />
/// <reference path="./testDefinitions/ReactDOM.d.ts" />
/// <reference path="./testDefinitions/ReactDOMClient.d.ts" />
/// <reference path="./testDefinitions/ReactInternalAct.d.ts" />
/*!
* 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.
*/
import React = require('react');
import ReactDOM = require('react-dom');
import ReactDOMClient = require('react-dom/client');
import PropTypes = require('prop-types');
import ReactFeatureFlags = require('shared/ReactFeatureFlags');
import TestUtils = require('internal-test-utils');
// Before Each
const assertConsoleErrorDev = TestUtils.assertConsoleErrorDev;
const assertConsoleWarnDev = TestUtils.assertConsoleWarnDev;
let container;
let root;
let attachedListener = null;
let renderedName = null;
class Inner extends React.Component {
getName() {
return this.props.name;
}
render() {
attachedListener = this.props.onClick;
renderedName = this.props.name;
return React.createElement('div', {className: this.props.name});
}
}
function test(element, expectedTag, expectedClassName) {
ReactDOM.flushSync(() => root.render(element));
expect(container.firstChild).not.toBeNull();
expect(container.firstChild.tagName).toBe(expectedTag);
expect(container.firstChild.className).toBe(expectedClassName);
}
// Classes need to be declared at the top level scope, so we declare all the
// classes that will be used by the tests below, instead of inlining them.
// TODO: Consider redesigning this using modules so that we can use non-unique
// names of classes and bundle them with the test code.
// it preserves the name of the class for use in error messages
// it throws if no render function is defined
class Empty extends React.Component {}
// it renders a simple stateless component with prop
class SimpleStateless extends React.Component {
props: any;
render() {
return React.createElement(Inner, {name: this.props.bar});
// ... (663 more lines)
Domain
Subdomains
Functions
Classes
- ArrayState
- BoundEventHandler
- ClassicProperties
- ClassicRefs
- Empty
- Example
- Foo
- ForceUpdateWithNoState
- InitialState
- Inner
- MisspelledComponent1
- MisspelledComponent2
- MisspelledComponent3
- NormalLifeCycles
- NullState
- NumberState
- ProvideChildContextTypes
- ProvideContext
- ReadContext
- RenderOnce
- SimpleStateless
- StateBasedOnContext
- StateBasedOnProps
- StringState
- UnboundEventHandler
Dependencies
- ReactFeatureFlags
- client
- internal-test-utils
- prop-types
- react
- react-dom
Source
Frequently Asked Questions
What does ReactTypeScriptClass-test.ts do?
ReactTypeScriptClass-test.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactTypeScriptClass-test.ts?
ReactTypeScriptClass-test.ts defines 1 function(s): test.
What does ReactTypeScriptClass-test.ts depend on?
ReactTypeScriptClass-test.ts imports 6 module(s): ReactFeatureFlags, client, internal-test-utils, prop-types, react, react-dom.
Where is ReactTypeScriptClass-test.ts in the architecture?
ReactTypeScriptClass-test.ts is located at packages/react/src/__tests__/ReactTypeScriptClass-test.ts (domain: BabelCompiler, subdomain: Validation, directory: packages/react/src/__tests__).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free