Update useQuery key but fetch in background #1668
-
Hello! I'm a little stuck trying to achieve something specific looking for a little help. I have a UI that fetches and displays data between two date ranges. I have a couple of calendar inputs that when the user clicks a date the
That's all good and works as expected, but what I'm trying to achieve now is when the query reruns What I'm thinking that I'd want is something like Thanks and sorry in advance if I missed in the docs how to achieve this. Thanks for you help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
keepPreviousData: true
is what you want. Read about lagged queries here: https://react-query.tanstack.com/guides/paginated-queries