TanStackT
TanStack2y ago
8 replies
then-purple

`data` becomes undefined / stale data for a second

I am using react-query like so. I am noticing that when I change the value of page via client state, the data returned by the
useQuery
reverts back to initialData while the fetch happens and then gets populated with the new data. It results in incorrect data being shown for the duration of the fetch (half a second).

How can I prevent this?
image.png
Was this page helpful?