On Page Load Query is vanished #5380
Unanswered
narutocarlo
asked this question in
Q&A
Replies: 1 comment
-
is your query client stable? https://tkdodo.eu/blog/react-query-fa-qs#2-the-queryclient-is-not-stable |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
"Hi everyone, I'm using Next.js and tanstack React Query to call an API and display data on a page based on a query parameter. I'm facing an issue where, when I reload the page, the data fetched using tanstack React Query disappears from the DevTools. The data is still visible on the page, but it looks like the query is not being cached or saved properly.
I've already tried using the initialData and keepPreviousData options in useQuery, as well as using the useEffect hook to refetch the data when the component mounts or the query parameter changes, but none of these solutions have worked.
Can anyone suggest a possible cause of this issue or another solution to try? Thank you for your help!"
i have shared the screen shot of these below
after Reload

before Reload

This is my code for this page
Beta Was this translation helpful? Give feedback.
All reactions