What is the right way to import queryClient with SSR?
Hey,
I am kinda confused what is the right way to access the
QueryClient
object in Svelte?
I found two options:
1. Getting it from "hook"
2. Accessing it from page data
Both of these examples have QueryClientProvider
in top root layout.
2 Replies
ratty-blushOP•3y ago
Why am I asking?
I would like to invalidate some queries when some event happens and I am not sure which method to choose.
First method:
Second method:
plain-purple•3y ago
Either is fine, I probably lean more towards useQueryClient since that's the way I used to use it in react-query.