Skip to content
Discussion options

You must be logged in to vote

all 5 pages of data are refreshed simultaneously

technically not true, they are fetched one after the other. But yes, they are all fetched.

How can I achieve refreshing only the first page of data and clearing the cache for other pages when the cache expires

spawn a useEffect that listens to isStale returned by useQuery, and call setQueryData to delete everything after the first page.

What this will achieve however is that after 1 minute, you'll only see one page on your screen, even if you have seen 5 before that. But it seems like that's what you want?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zmm2tysu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants