T
TanStack6mo ago
other-emerald

Sharing router.context.queryClient and persistence hydration

Hey guys, I'm currently using the Start template with Router, Query and Persist Client. What I'm trying to do is, having a query so that client-side part can persist access token and hydrate them on mount. I'm trying to reuse the queryClient from router context instead of creating a new client. Somehow it doesn't work because the dataUpdatedAt from the storage will always be lt query.state.dataUpdatedAt which void the setter of state. https://github.com/TanStack/query/blob/a9b073a85edc45331d4b346be8e5bf2660507e53/packages/query-core/src/hydration.ts#L200 Could you help me with this? Thanks a lot.
1 Reply
other-emerald
other-emeraldOP6mo ago
Bump for visibility.

Did you find this page helpful?