You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using NextJs with SWR for my project.
Whenever I tried to call the useSWR hooks, I will receive the following error message.
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
TypeError: Cannot read properties of null (reading 'useContext')
I have no idea how is this error actually happens.
The following is the exact code in the project.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone.
I am using NextJs with SWR for my project.
Whenever I tried to call the
useSWR
hooks, I will receive the following error message.I have no idea how is this error actually happens.
The following is the exact code in the project.
can anyone shed some light please.
Beta Was this translation helpful? Give feedback.
All reactions