T
TanStack3y ago
sunny-green

React Query and SSR Combined doubt

Hi, I'm working with React Query and SSR (NextJs) and I want to combine SSR with client side. Is it possible to share cache between client side and server side?? For exemplo: I want to prefetch the data in SSR and hydratate to client side, but if leave this page and get back, the data will prefetch again but in the client side is fresh yet. Could anyone help whit this?
4 Replies
inland-turquoise
inland-turquoise3y ago
yes its possible; please see the docs
sunny-green
sunny-greenOP3y ago
Which part? Because a see SSR and didn't work
inland-turquoise
inland-turquoise3y ago
the part about the app dir if you use next13. if you have something that doesn't work, please share a reproduction
sunny-green
sunny-greenOP3y ago
I think that's it, I'm not using next13 yet, I'm on v12... I'll create a new sample project with next13 to try this

Did you find this page helpful?