Skip to content

Triggering immediate refetch on refresh with persistQueryClient #8272

Answered by TkDodo
GarrisonBates asked this question in Q&A
Discussion options

You must be logged in to vote

whereas I had thought it would rehydrate from localStorage and then refetch in the background.

it should refetch in the background if the data is considered stale, so it depends on your staleTime setting. You can also call queryClient.invalidateQueries() in the onSuccess handler of the QueryClientProvider to force a refetch of everything.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GarrisonBates
Comment options

Answer selected by GarrisonBates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants