Home / File/ todo-function-expression-captures-value-later-frozen.js — react Source File

todo-function-expression-captures-value-later-frozen.js — react Source File

Architecture documentation for todo-function-expression-captures-value-later-frozen.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

function Component(props) {
  let x = {};
  // onChange should be inferred as immutable, because the value
  // it captures (`x`) is frozen by the time the function is referenced
  const onChange = e => {
    maybeMutate(x, e.target.value);
  };
  if (props.cond) {
    <div>{x}</div>;
  }
  // ideally this call would be outside the memoization block for `x`
  onChange();
  return <Foo value={x} />;
}

Subdomains

Functions

Frequently Asked Questions

What does todo-function-expression-captures-value-later-frozen.js do?
todo-function-expression-captures-value-later-frozen.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 todo-function-expression-captures-value-later-frozen.js?
todo-function-expression-captures-value-later-frozen.js defines 1 function(s): Component.
Where is todo-function-expression-captures-value-later-frozen.js in the architecture?
todo-function-expression-captures-value-later-frozen.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-function-expression-captures-value-later-frozen.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