TanStackT
TanStack2y ago
16 replies
verbal-lime

queryClient.getQueryData returns undefined when page refresh

Hey guys i encountered the weird issue with queryClient.getQueryData which returns undefined when I refresh the page. But i can see the cache data in localstorage. and the other thing is its working fine when i run with localhost connecting the soruce. but when it builds its undefined on page refresh
const queryClient = new QueryClient(); const articleStories = queryClient.getQueryData(['home-data']);

React query version is ^4.29.7
Was this page helpful?