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

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

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

Entity Profile

Dependency Diagram

graph LR
  a35acc2d_b04e_36aa_2977_b64f87d841ff["error.todo-for-in-loop-with-context-variable-iterator.js"]
  9b88626e_0355_91af_db84_89f44a65ebc6["shared-runtime"]
  a35acc2d_b04e_36aa_2977_b64f87d841ff --> 9b88626e_0355_91af_db84_89f44a65ebc6
  style a35acc2d_b04e_36aa_2977_b64f87d841ff 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 key in props.data) {
    key = key ?? null; // no-op reassignment to force a context variable
    items.push(
      <div key={key} onClick={() => data.set(key)}>
        {key}
      </div>
    );
  }
  return <div>{items}</div>;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{data: {a: 'a', b: true, c: 'hello'}}],
};

Domain

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

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