Home / Function/ useEffectEventError() — react Function Reference

useEffectEventError() — react Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js lines 2083–2098

function useEffectEventError(fn, called) {
  if (fn === null) {
    return {
      message:
        `React Hook "useEffectEvent" can only be called at the top level of your component.` +
        ` It cannot be passed down.`,
    };
  }

  return {
    message:
      `\`${fn}\` is a function created with React Hook "useEffectEvent", and can only be called from ` +
      'Effects and Effect Events in the same component.' +
      (called ? '' : ' It cannot be assigned to a variable or passed down.'),
  };
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free