Closed HelNershingThapa closed 2 months ago
your issue reproduction works for me. Ater reloading the app, I do see isButtonClicked: true
.
Note that writes are throttled (one write per second) so if you click the button and instantly quit the app, it likely won't be saved.
Describe the bug
I'm experiencing an issue where data set using
setQueryData
is not being persisted when usingPersistQueryClientProvider
. I am using@react-native-async-storage/async-storage
as the storage solution.Your minimal, reproducible example
https://snack.expo.dev/@helnershingthapa/setquerydata-with-persistqueryclientprovider
Steps to reproduce
PersistQueryClientProvider
with a persister created usingcreateAsyncStoragePersister
.setQueryData
to create query's data within a component. Click the button to update the query data.Expected behavior
The expectation is that data should persist across sessions.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
v5.56.2
TypeScript version
v5.3.3
Additional context
No response