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

ReactPersistentUpdatesMinimalism-test.js — react Source File

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

'use strict';

let React;
let ReactNoopPersistent;
let act;

describe('ReactPersistentUpdatesMinimalism', () => {
  beforeEach(() => {
    jest.resetModules();
    React = require('react');
    ReactNoopPersistent = require('react-noop-renderer/persistent');
    act = require('internal-test-utils').act;
  });

  it('should render a simple component', async () => {
    function Child() {
      return <div>Hello World</div>;
    }

    function Parent() {
      return <Child />;
    }

    ReactNoopPersistent.startTrackingHostCounters();
    await act(() => ReactNoopPersistent.render(<Parent />));
    expect(ReactNoopPersistent.stopTrackingHostCounters()).toEqual({
      hostCloneCounter: 0,
    });

    ReactNoopPersistent.startTrackingHostCounters();
    await act(() => ReactNoopPersistent.render(<Parent />));
    expect(ReactNoopPersistent.stopTrackingHostCounters()).toEqual({
      hostCloneCounter: 1,
    });
  });

  it('should not diff referentially equal host elements', async () => {
    function Leaf(props) {
      return (
        <span>
          hello
          <b />
          {props.name}
        </span>
      );
    }

    const constEl = (
      <div>
        <Leaf name="world" />
// ... (97 more lines)

Domain

Subdomains

Classes

Frequently Asked Questions

What does ReactPersistentUpdatesMinimalism-test.js do?
ReactPersistentUpdatesMinimalism-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
Where is ReactPersistentUpdatesMinimalism-test.js in the architecture?
ReactPersistentUpdatesMinimalism-test.js is located at packages/react-reconciler/src/__tests__/ReactPersistentUpdatesMinimalism-test.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-reconciler/src/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free