React
Invalid hook call
React detected a hook being used outside of a valid function component or custom hook context.
React
React detected a hook being used outside of a valid function component or custom hook context.
Observed message
Invalid hook call. Hooks can only be called inside of the body of a function component.
Why it happens
How to fix it
Official reference
React Docs: Invalid Hook Call WarningRelated errors
Explore more