Home / File/ ReactDOMServerIntegrationUserInteraction-test.js — react Source File

ReactDOMServerIntegrationUserInteraction-test.js — react Source File

Architecture documentation for ReactDOMServerIntegrationUserInteraction-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
 */

'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, itClientRenders, renderIntoDom, serverRender} =
  ReactDOMServerIntegrationUtils(initModules);

describe('ReactDOMServerIntegrationUserInteraction', () => {
  let ControlledInput, ControlledTextArea, ControlledCheckbox, ControlledSelect;

  beforeEach(() => {
    resetModules();
    ControlledInput = class extends React.Component {
      static defaultProps = {
        type: 'text',
        initialValue: 'Hello',
      };
      constructor() {
        super(...arguments);
        this.state = {value: this.props.initialValue};
      }
      handleChange(event) {
        if (this.props.onChange) {
          this.props.onChange(event);
        }
        this.setState({value: event.target.value});
      }
      componentDidMount() {
        if (this.props.cascade) {
          // Trigger a cascading render immediately upon hydration which rerenders the input.
          this.setState({cascade: true});
        }
      }
// ... (385 more lines)

Domain

Subdomains

Functions

Frequently Asked Questions

What does ReactDOMServerIntegrationUserInteraction-test.js do?
ReactDOMServerIntegrationUserInteraction-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 ReactDOMServerIntegrationUserInteraction-test.js?
ReactDOMServerIntegrationUserInteraction-test.js defines 1 function(s): initModules.
Where is ReactDOMServerIntegrationUserInteraction-test.js in the architecture?
ReactDOMServerIntegrationUserInteraction-test.js is located at packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-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