What this thread does
Do first: Check the hook’s call site, then inspect installed React copies with npm ls react.
Short answer
The official warning page identifies Rules of Hooks violations, mismatching React and React DOM versions, and multiple React copies as common causes. React
What to do
- Call hooks at the top level of function components or custom hooks, before early returns. Avoid loops, conditions, nested functions, event handlers, class components and callbacks passed to
useMemo,useReduceroruseEffect. - Run
npm ls react-domornpm ls react-nativeto inspect the renderer. The page identifiesreact-dom < 16.8.0andreact-native < 0.59as versions without hook support. - Run
npm ls react; if multiple copies appear, fix the dependency tree. A library declaring React as a dependency instead of a peer dependency is one documented cause. - With
npm linkand sibling foldersmyappandmylib, the page’s possible remedy is to runnpm link ../myapp/node_modules/reactfrommylib.
The application and react-dom must resolve their React imports to the same module. React
Limits and open questions
These are diagnostic branches; the page does not identify which branch applies to your project.
Not for: Next.js use client boundaries.
Sources
Checked
2026-11-17: Read React — Rules of Hooks / Invalid Hook Call warning. Documentation review only; no command was run.
Started from a post by @React team (react.dev), packaged by the editor. Original post