Home / Function/ constructor() — react Function Reference

constructor() — react Function Reference

Architecture documentation for the constructor() function in code-path-state.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  55fda85d_f10e_7e7f_11dd_a4ad601ffd62["constructor()"]
  d3cee22c_5e2d_f853_c075_2c7c55e5d22c["CodePathState"]
  55fda85d_f10e_7e7f_11dd_a4ad601ffd62 -->|defined in| d3cee22c_5e2d_f853_c075_2c7c55e5d22c
  style 55fda85d_f10e_7e7f_11dd_a4ad601ffd62 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js lines 228–249

  constructor(idGenerator, onLooped) {
    this.idGenerator = idGenerator;
    this.notifyLooped = onLooped;
    this.forkContext = ForkContext.newRoot(idGenerator);
    this.choiceContext = null;
    this.switchContext = null;
    this.tryContext = null;
    this.loopContext = null;
    this.breakContext = null;
    this.chainContext = null;

    this.currentSegments = [];
    this.initialSegment = this.forkContext.head[0];

    // returnedSegments and thrownSegments push elements into finalSegments also.
    const final = (this.finalSegments = []);
    const returned = (this.returnedForkContext = []);
    const thrown = (this.thrownForkContext = []);

    returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final);
    thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final);
  }

Domain

Subdomains

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js.
Where is constructor() defined?
constructor() is defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js at line 228.

Analyze Your Own Codebase

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

Try Supermodel Free