Fetch data qith useQuery Next.js cookie #2889
-
Hey! I'm using react query for the first time, and got a little stuck using a query to fetch data. I'm not sure how the useQuery function works in my React component. My code below doesn't work, as I am getting
Can anybody point me in the right direction? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
the from prefetching have to match the keys exactly on
on the server, you also need to use
so here, you would need to use the same key, and also pass the cookie to
|
Beta Was this translation helpful? Give feedback.
the from prefetching have to match the keys exactly on
useQuery
. So if you do:on the server, you also need to use
["users", cookie]
on the client.so here, you would need to use the same key, and also pass the cookie to
getLiftsFromUsers
, like: