#server component + react query
33 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
you can separate the function and pass the data into the prefetch query
const data = await getData()
qc.prefetchQuery({
queryKey:
queryFn: () => data
})
also what theme are you using?
And, how the best form to run my func data? useEffect?
wdym?
About theme, i use polacode to take a print to code,
that is in the server component, you can't use useEffect
This config
thanks
i forgot this detail
what do you want to do?
I tried this way but it's complaining
what does the error say
i can't help you if you dont send enough information
Variable 'prefetchQuery' implicitly has an 'any' type.ts(7005)
"@tanstack/react-query": "^5.17.19",
can you update it to latest
5.20
because its doing just fine for me
while you're at it can you send the full code?
including the imports
Yes, thank you very much worked