Error AtlasError Documentation and Resolution

React invalid hook call

Invalid hook call. Hooks can only be called inside of the body of a function component.

React detected a Hook being called in an unsupported location, such as outside a function component or custom Hook, and stopped rendering with the invalid hook call error.

React error #404runtime
Invalid hook call. Hooks can only be called inside of the body of a function component.
  • A Hook is being called conditionally or outside a function component or custom Hook.
  • The app has multiple copies of React installed.
  • A Hook is being called from a regular function instead of a React component or custom Hook.
  1. Move the Hook call into the top level of a function component or custom Hook.
  2. Audit the dependency tree for multiple React installations.
  3. Review shared utilities and event handlers for accidental Hook usage.
React Docs: Minified React error #404
React Invalid Hook Call: error #404 explained and fixed | Error Atlas