T
TanStack3y ago
fascinating-indigo

Persisting queries containing dates

Has anyone tackled the issue of deserializing dates contained in queries while using PersistQueryClientProvider? I understand this is not trivial since JSON does not have a type for Date, nonetheless it seems a common use case and I could not find any reference in the docs or previous questions. I just started using the provider with React Native and the async storage persister: the app is immediately usable in offline mode, which I like, but all dates are broken! Dates are currently received from the API in ISO 8601 format, but they are casted to Date by our autogenerated TS API client, which gets called into the TanStack query callbacks: any suggestion to obtain automatic rehydration when data is read from the storage?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?