Home / File/ error.unconditional-set-state-in-render-with-loop-throw.js — react Source File

error.unconditional-set-state-in-render-with-loop-throw.js — react Source File

Architecture documentation for error.unconditional-set-state-in-render-with-loop-throw.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// @validateNoSetStateInRender
function Component(props) {
  const [state, setState] = useState(false);
  for (const _ of props) {
    if (props.cond) {
      break;
    } else {
      throw new Error('bye!');
    }
  }
  setState(true);
  return state;
}

Subdomains

Functions

Frequently Asked Questions

What does error.unconditional-set-state-in-render-with-loop-throw.js do?
error.unconditional-set-state-in-render-with-loop-throw.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.unconditional-set-state-in-render-with-loop-throw.js?
error.unconditional-set-state-in-render-with-loop-throw.js defines 1 function(s): Component.
Where is error.unconditional-set-state-in-render-with-loop-throw.js in the architecture?
error.unconditional-set-state-in-render-with-loop-throw.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.unconditional-set-state-in-render-with-loop-throw.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