What is the correct way to reset data array in useInfiniteQuery
#1628
Unanswered
marik22312
asked this question in
Q&A
Replies: 1 comment
-
|
Check this one out! In your case, you just have to pass the query key when calling. Btw, how do you compose your query keys? Because if you do it better you won't need to reset queries. |
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.
-
Hey, I have a table with an infinite scroll which uses
useInfiniteQueryand basically always displayed the received data. (using react-query v2)in some cases, I need to query my API with a new filter instead of a new page cursor.
for example
I'm trying to reset the
dataarray after querying with the newquerykey, sodatawill contain only the latest response from the API.tried doing this with the
resetandclearmethods, but it doesn't seem to clear the data array...Beta Was this translation helpful? Give feedback.
All reactions