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
harsh-harlequin•14mo 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
correct-apricotOP•14mo 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
harsh-harlequin•14mo ago
Sure! I'm not an expert by any means but I'll try to help however I can