T
TanStack2y ago
optimistic-gold

Query refetches when page is refreshed even if refetchOnMount is false.

I switched to typescript recently. I applied the same configs with my old project to my new project but it is not working like the old one. In the old one projects are not refetched even if I refresh the page so project selection combobox doesn't flicker when page is refreshed but now it is refetching. Note: I was using keepPreviousData: truein my old project but I gues it is deprecated.
No description
3 Replies
multiple-amethyst
multiple-amethyst2y ago
You obviously also updated query to v5 which introduced some changes. A refresh (like hitting F5) always flushes the cache and thus introduces a refetch.
probable-pink
probable-pink2y ago
In the old one projects are not refetched even if I refresh the page
this is impossible unless you were using a persist plugin ?
optimistic-gold
optimistic-goldOP2y ago
Yes, I realized that I was storing projects in localstorage. Thanks guys, I fixed this problem by doing the same!

Did you find this page helpful?