Home / Function/ getThrowContext() — react Function Reference

getThrowContext() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d986cf23_ac32_702c_8619_6a4499c7dba5["getThrowContext()"]
  6e2aa007_860b_49d4_8a7b_6b55d63818e5["code-path-state.js"]
  d986cf23_ac32_702c_8619_6a4499c7dba5 -->|defined in| 6e2aa007_860b_49d4_8a7b_6b55d63818e5
  fdc317a5_31e7_89af_23f5_c54520226a3f["popTryContext()"]
  fdc317a5_31e7_89af_23f5_c54520226a3f -->|calls| d986cf23_ac32_702c_8619_6a4499c7dba5
  1963d6ce_91bb_f67c_f0d9_c7097c58e194["makeFirstThrowablePathInTryBlock()"]
  1963d6ce_91bb_f67c_f0d9_c7097c58e194 -->|calls| d986cf23_ac32_702c_8619_6a4499c7dba5
  3f6646ba_6d99_56b5_5137_7c0b81d1594e["makeThrow()"]
  3f6646ba_6d99_56b5_5137_7c0b81d1594e -->|calls| d986cf23_ac32_702c_8619_6a4499c7dba5
  style d986cf23_ac32_702c_8619_6a4499c7dba5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

function getThrowContext(state) {
  let context = state.tryContext;

  while (context) {
    if (
      context.position === 'try' ||
      (context.hasFinalizer && context.position === 'catch')
    ) {
      return context;
    }
    context = context.upper;
  }

  return state;
}

Domain

Subdomains

Frequently Asked Questions

What does getThrowContext() do?
getThrowContext() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js.
Where is getThrowContext() defined?
getThrowContext() is defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js at line 106.
What calls getThrowContext()?
getThrowContext() is called by 3 function(s): makeFirstThrowablePathInTryBlock, makeThrow, popTryContext.

Analyze Your Own Codebase

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

Try Supermodel Free