TanStackT
TanStack3y ago
21 replies
moderate-tomato

React Query not respecting initialData when there is cache

I have a cart state stored in the cache with the key "cart." When I try to fetch cart information on the server and send it to the client using initialData, the server's data is not replacing the existing cache.

Is there a way to make initialData overwrite the cache?
image.png
Was this page helpful?