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: true
in my old project but I gues it is deprecated.
3 Replies
xenial-black•2y 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.
exotic-emerald•2y ago
In the old one projects are not refetched even if I refresh the pagethis is impossible unless you were using a persist plugin ?
other-emeraldOP•2y ago
Yes, I realized that I was storing projects in localstorage. Thanks guys, I fixed this problem by doing the same!