safak / youtube2022

Season 2 on Lama Dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internet connection and using then on the social-app branch (React)

FREDVUNI opened this issue · comments

  • You need to be connected to the internet in order to use react-query.
  • You may also encounter issues when you use then when fetching data, To fix this you can use async instead.

something like this:
const { isLoading, error, data } = useQuery( ["user", currentUser.id], async () => { const response = await makeRequest.get("/users/find/" + userId); return response.data; } );