Show different loading on key change using useInfiniteQuery #8459
Unanswered
J4v4Scr1pt
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have situation where I can change the key in useInfiniteQuery. This will trigger a new fetch for the hook.
Every thing works great except one little annoying detail. When the key changes it triggers my wrapping suspense but not for as long as the fetch takes. And to my knowledge useInfiniteQuery do not expose any variable that tells you it fetching new data för a new key.
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.
All reactions