diff --git a/constants/storage.ts b/constants/storage.ts index 43aa7dc9..66dfddf9 100644 --- a/constants/storage.ts +++ b/constants/storage.ts @@ -1,5 +1,7 @@ import { MMKV } from "react-native-mmkv"; import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister"; +import { persistQueryClient } from "@tanstack/react-query-persist-client"; +import { queryClient } from "./query-client"; export const storage = new MMKV(); @@ -16,4 +18,9 @@ const clientStorage = { }, }; - export const clientPersister = createSyncStoragePersister({ storage: clientStorage }); \ No newline at end of file + export const clientPersister = createSyncStoragePersister({ storage: clientStorage }); + + persistQueryClient({ + queryClient, + persister: clientPersister + }); \ No newline at end of file