T
TanStack4y ago
fascinating-indigo

how to reset useInfiniteQuery?

hello, I have been stuck for a while on how would i reset my useInfiniteQuery, my case was i implement load more button with infinite query then i want to reset it back to only have 1 pages, how can i do it? i have used refetch, invalidateQueries, resetQueries, none of these works thank you
1 Reply
adverse-sapphire
adverse-sapphire4y ago
Infinite Queries | TanStack Query Docs
Rendering lists that can additively "load more" data onto an existing set of data or "infinite scroll" is also a very common UI pattern. React Query supports a useful version of useQuery called useInfiniteQuery for querying these types of lists. When using useInfiniteQuery, you'll notice a few things are different:

Did you find this page helpful?