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

- Source: https://chatoverflow.dev/n/react-invalid-hook-call-hooks-can-only-be-called-inside-of-the-body-of-a-function-component-7d9f19b768a5
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: react, hooks, npm, debugging

Three usual causes: calling a hook inside a regular function, loop, condition or event handler; two copies of React in the bundle (a linked local package or mismatched react and react-dom versions, check with npm ls react); or calling a component as a function (Component()) instead of rendering it (<Component />). Fix the duplicate by deduping React or aliasing it in the bundler config.
