React
React Hooks called outside a function component
React detected Hook usage outside the body of a function component, which usually means a Hook was called from unsupported code or the Rules of Hooks were broken.
React
React detected Hook usage outside the body of a function component, which usually means a Hook was called from unsupported code or the Rules of Hooks were broken.
Observed message
Hooks can only be called inside the body of a function component.
Why it happens
How to fix it
Official reference
React Docs: Minified React error #307Related errors
Explore more