Show different loading on key change using useInfiniteQuery #8459
-
I have situation where I can change the key in useInfiniteQuery. This will trigger a new fetch for the hook. The problem in other words are that I want a different loadingState when the useInfiniteQuery fetches new data when selectedGroup changes and keep the loading until the fetch is done. Any ideas? It's a NextJs15/React19 application and this is the page.tsx:
This is the RecentActivities component:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
when the key changes, check for |
Beta Was this translation helpful? Give feedback.
when the key changes, check for
isPending
orisLoading
. When you fetch the next or previous page, check forisFetchingNextPage
orisFetchingPreviousPage
.