Skip to content
Discussion options

You must be logged in to vote

keepPreviousData works on a per-observer basis. Meaning if you have one call of useQuery, and you render the same component again and the key changes, it will keep the data it had before.

If you change the route and render a completely different component, you'll get a new observer, so there is not previous data to keep. You would need to re-render the same component on a route change to achieve that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ask1n
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