-
I am trying to call a hook that grabs the data of an authenticated user. I cant seem do that anywhere in _app.js Server ErrorError: Invalid hook call. Hooks can only be called inside of the body of a function component. Any suggestions |
Beta Was this translation helpful? Give feedback.
Answered by
laugharn
Sep 8, 2020
Replies: 1 comment 2 replies
-
You need to write _app.js as a functional component. function App({ Component, pageProps }) {
const [value, setValue] = useState()
return <Component {...pageProps} />
}
export default App |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
jamesmosier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to write _app.js as a functional component.