T
TanStack16mo ago
extended-salmon

react-query + react + astro + ssr

Hello guys, I'll be trying to integrate react-query with Astro and React using SSR. Is this possible? I've been doing dome research but I couldn't find any repo/blog about this. Have you guys faced any issues with this?
3 Replies
adverse-sapphire
adverse-sapphire16mo ago
I tried this and could never get prefetching with SSR working quite right. It mostly worked, but had a lot of weird rendering issues that would come and go and I could never debug it is possible but you may end up having to drop tanstack query's prefetching & hydration API and instead do the SSR by manually fetching and passing initialData as props if you only need it for one or two islands within astro its totally manageable, but if youre thinking to use it more on every page then you're probably better off with a fully fledged react framework like nextjs or something, astro does run into limits
extended-salmon
extended-salmonOP16mo ago
Could I send you a DM? I'd like to discuss some things related to SSR for a high traffic website I'm trying to migrate
adverse-sapphire
adverse-sapphire16mo ago
Sure! I'm not an expert by any means but I'll try to help however I can

Did you find this page helpful?