Home / Function/ classError() — react Function Reference

classError() — react Function Reference

Architecture documentation for the classError() function in ESLintRulesOfHooks-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f32de38c_56ea_4ffc_278b_321a6a09d413["classError()"]
  dd0557d9_69a8_cf13_71c6_3353d5972ec8["ESLintRulesOfHooks-test.js"]
  f32de38c_56ea_4ffc_278b_321a6a09d413 -->|defined in| dd0557d9_69a8_cf13_71c6_3353d5972ec8
  style f32de38c_56ea_4ffc_278b_321a6a09d413 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js lines 2074–2081

function classError(hook) {
  return {
    message:
      `React Hook "${hook}" cannot be called in a class component. React Hooks ` +
      'must be called in a React function component or a custom React ' +
      'Hook function.',
  };
}

Domain

Subdomains

Frequently Asked Questions

What does classError() do?
classError() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js.
Where is classError() defined?
classError() is defined in packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js at line 2074.

Analyze Your Own Codebase

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

Try Supermodel Free