-
Hi! Thanks for always being there!! How can I clear the entire react-query cache data for example if the user logs out? What I tried: const handleLogout = async () => {
await secureStorage.deleteItemAsync('token')
await asyncStorage.removeItem('REACT_QUERY_OFFLINE_CACHE')
....
} But that doesn't seem to work, please how can I archive that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
not sure which "cache storage" you are talking about. The react-query in-memory cache can be cleared with other than that, if you are using any of the storage plugins - if you clear the queryCache, it should also sync that to external storages. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I'm using a storage plugin, so is there a way to clear the entire storage at once? |
Beta Was this translation helpful? Give feedback.
not sure which "cache storage" you are talking about. The react-query in-memory cache can be cleared with
queryClient.clear()
other than that, if you are using any of the storage plugins - if you clear the queryCache, it should also sync that to external storages.