-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refetchOnWindowFocus
is not working (v5)
#6351
Comments
I'm not really sure how svelte works, but somewhere, we need to call query/packages/react-query/src/QueryClientProvider.tsx Lines 33 to 38 in 1d3ee67
What's the equivalent for svelte here? @lachlancollins might know this :) |
@TkDodo the equivalent mount/unmount logic should be this: query/packages/svelte-query/src/QueryClientProvider.svelte Lines 8 to 16 in 73e3396
|
@frederikhors Dominik was correct, you need to add the QueryClientProvider component somewhere in your app. The most common place to put this is
Then you would remove this from
If you needed the client from context you could call You can see the docs here: https://tanstack.com/query/latest/docs/svelte/overview |
It works! Thanks! |
Describe the bug
I just found out that
refetchOnWindowFocus
is not working.I have this setup:
and even if the below works:
tanstack/query does not reload queries when
visibilitychange
s.Can you confirm?
Your minimal, reproducible example
https://stackblitz.com/edit/sveltejs-kit-template-default-6ntbzr?file=src%2Froutes%2F%2Bpage.svelte,src%2Fapp.html
How often does this bug happen?
Every time
Platform
Win 10, Chrome 119.0.6045.124.
Tanstack Query adapter
svelte-query
TanStack Query version
5.4.3
TypeScript version
5
Additional context
The text was updated successfully, but these errors were encountered: