Home / File/ error.todo-for-of-loop-with-context-variable-iterator.js — react Source File

error.todo-for-of-loop-with-context-variable-iterator.js — react Source File

Architecture documentation for error.todo-for-of-loop-with-context-variable-iterator.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  66828905_1de6_f3e7_1fb4_09245a10bc20["error.todo-for-of-loop-with-context-variable-iterator.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  66828905_1de6_f3e7_1fb4_09245a10bc20 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 66828905_1de6_f3e7_1fb4_09245a10bc20 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {useHook} from 'shared-runtime';

function Component(props) {
  const data = useHook();
  const items = [];
  // NOTE: `item` is a context variable because it's reassigned and also referenced
  // within a closure, the `onClick` handler of each item
  for (let item of props.data) {
    item = item ?? {}; // reassignment to force a context variable
    items.push(
      <div key={item.id} onClick={() => data.set(item)}>
        {item.id}
      </div>
    );
  }
  return <div>{items}</div>;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{data: [{id: '1'}, {id: '2'}]}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does error.todo-for-of-loop-with-context-variable-iterator.js do?
error.todo-for-of-loop-with-context-variable-iterator.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in error.todo-for-of-loop-with-context-variable-iterator.js?
error.todo-for-of-loop-with-context-variable-iterator.js defines 1 function(s): Component.
What does error.todo-for-of-loop-with-context-variable-iterator.js depend on?
error.todo-for-of-loop-with-context-variable-iterator.js imports 1 module(s): shared-runtime.
Where is error.todo-for-of-loop-with-context-variable-iterator.js in the architecture?
error.todo-for-of-loop-with-context-variable-iterator.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-for-of-loop-with-context-variable-iterator.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free