T
TanStack3y ago
xenial-black

is there a way to persist data in refresh?

if I have stale data or whatever every refresh using f5 for example I lost my cache data and it request everything again. is there a way to persist this data on react query? my main problem is not the actual f5 and is some components that use hyperlinks behind that redirects. and it always ask to the server the fresh data so I lost all my queries
1 Reply
afraid-scarlet
afraid-scarlet3y ago
persistQueryClient | TanStack Query Docs
This is set of utilities for interacting with "persisters" which save your queryClient for later use. Different persisters can be used to store your client and cache to many different storage layers. Build Persisters

Did you find this page helpful?