Home / File/ repro-array-filter-capture-mutate-bug.tsx — react Source File

repro-array-filter-capture-mutate-bug.tsx — react Source File

Architecture documentation for repro-array-filter-capture-mutate-bug.tsx, a tsx file in the react codebase. 1 imports, 0 dependents.

File tsx TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  247b2728_ff50_e4a1_f4a3_f305044748fc["repro-array-filter-capture-mutate-bug.tsx"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  247b2728_ff50_e4a1_f4a3_f305044748fc --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 247b2728_ff50_e4a1_f4a3_f305044748fc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {mutateAndReturn, Stringify, useIdentity} from 'shared-runtime';

/**
 * Repro for bug with `mutableOnlyIfOperandsAreMutable` flag
 * Found differences in evaluator results
  * Non-forget (expected):
  * (kind: ok)
  * <div>{"children":[{"value":"foo","wat0":"joe"},{"value":5,"wat0":"joe"}]}</div>
  * <div>{"children":[{"value":"foo","wat0":"joe"},{"value":6,"wat0":"joe"}]}</div>
  * <div>{"children":[{"value":"foo","wat0":"joe"},{"value":6,"wat0":"joe"}]}</div>
  * Forget:
  * (kind: ok)
  * <div>{"children":[{"value":"foo","wat0":"joe"},{"value":5,"wat0":"joe"}]}</div>
  * <div>{"children":[{"value":"foo","wat0":"joe","wat1":"joe"},{"value":6,"wat0":"joe"}]}</div>
  * <div>{"children":[{"value":"foo","wat0":"joe","wat1":"joe"},{"value":6,"wat0":"joe"}]}</div>

 */
function Component({value}) {
  const arr = [{value: 'foo'}, {value: 'bar'}, {value}];
  useIdentity(null);
  const derived = arr.filter(mutateAndReturn);
  return (
    <Stringify>
      {derived.at(0)}
      {derived.at(-1)}
    </Stringify>
  );
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{value: 5}],
  sequentialRenders: [{value: 5}, {value: 6}, {value: 6}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does repro-array-filter-capture-mutate-bug.tsx do?
repro-array-filter-capture-mutate-bug.tsx is a source file in the react codebase, written in tsx. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in repro-array-filter-capture-mutate-bug.tsx?
repro-array-filter-capture-mutate-bug.tsx defines 1 function(s): Component.
What does repro-array-filter-capture-mutate-bug.tsx depend on?
repro-array-filter-capture-mutate-bug.tsx imports 1 module(s): shared-runtime.
Where is repro-array-filter-capture-mutate-bug.tsx in the architecture?
repro-array-filter-capture-mutate-bug.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/global-types/repro-array-filter-capture-mutate-bug.tsx (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/global-types).

Analyze Your Own Codebase

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

Try Supermodel Free