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

profilerChangeDescriptions-test.js — react Source File

Architecture documentation for profilerChangeDescriptions-test.js, a javascript file in the react codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  4414a89f_3802_03d9_7133_17cfe6fc1ac4["profilerChangeDescriptions-test.js"]
  7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4["utils.js"]
  4414a89f_3802_03d9_7133_17cfe6fc1ac4 --> 7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4
  style 4414a89f_3802_03d9_7133_17cfe6fc1ac4 fill:#6366f1,stroke:#818cf8,color:#fff

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.
 *
 * @flow
 */

import {getVersionedRenderImplementation} from './utils';

describe('Profiler change descriptions', () => {
  let React;
  let store;
  let utils;

  beforeEach(() => {
    utils = require('./utils');
    utils.beforeEachProfiling();

    store = global.store;
    store.collapseNodesByDefault = false;
    store.recordChangeDescriptions = true;

    React = require('react');
  });

  const {render} = getVersionedRenderImplementation();

  // @reactVersion >=18.0
  it('should identify useContext as the cause for a re-render', () => {
    const Context = React.createContext(0);

    function Child() {
      const context = React.useContext(Context);
      return context;
    }

    function areEqual() {
      return true;
    }

    const MemoizedChild = React.memo(Child, areEqual);
    const ForwardRefChild = React.forwardRef(
      function RefForwardingComponent(props, ref) {
        return <Child />;
      },
    );

    let forceUpdate = null;

    const App = function App() {
      const [val, dispatch] = React.useReducer(x => x + 1, 0);

      forceUpdate = dispatch;

      return (
        <Context.Provider value={val}>
          <Child />
          <MemoizedChild />
// ... (91 more lines)

Domain

Dependencies

Frequently Asked Questions

What does profilerChangeDescriptions-test.js do?
profilerChangeDescriptions-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does profilerChangeDescriptions-test.js depend on?
profilerChangeDescriptions-test.js imports 1 module(s): utils.js.
Where is profilerChangeDescriptions-test.js in the architecture?
profilerChangeDescriptions-test.js is located at packages/react-devtools-shared/src/__tests__/profilerChangeDescriptions-test.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free