kevin51jiang / react-spotify-auth

Easy Spotify Authentication, written in React
42 stars 18 forks source link

Error: Invalid hook call. #25

Closed rohawala closed 3 years ago

rohawala commented 4 years ago

I am getting below error after getting token.

Error: 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://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

I tried all solutions mentioned above. Please help

kevin51jiang commented 4 years ago

Hi, could you give me a bit more info on how you're using it?

rohawala commented 4 years ago

Hi,

I have just taken the example provided after user authentication page when I refresh it shows the above error where it should display user information and profile picture. Even after converting the function to Class and using State instead of hooks I am getting the same error . I think when it is fetching the cookie some where there the above exception takes place.

kevin51jiang commented 3 years ago

So sorry this slipped under my radar.

Did you manage to fix it? If not are you able to send some example code of how you're using the component?

kevin51jiang commented 3 years ago

Closing because inactive