Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in error.invalid-setState-in-render-unbound-state.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  bc69dba5_9c7f_6142_5ce6_d40e7c53f93c["Component()"]
  184e54b2_014c_83f1_a586_094dce16a339["error.invalid-setState-in-render-unbound-state.js"]
  bc69dba5_9c7f_6142_5ce6_d40e7c53f93c -->|defined in| 184e54b2_014c_83f1_a586_094dce16a339
  style bc69dba5_9c7f_6142_5ce6_d40e7c53f93c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-setState-in-render-unbound-state.js lines 1–7

function Component(props) {
  // Intentionally don't bind state, this repros a bug where we didn't
  // infer the type of destructured properties after a hole in the array
  let [, setState] = useState();
  setState(1);
  return props.foo;
}

Subdomains

Frequently Asked Questions

What does Component() do?
Component() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-setState-in-render-unbound-state.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-setState-in-render-unbound-state.js at line 1.

Analyze Your Own Codebase

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

Try Supermodel Free