Feature Request: Alternative to isLoading for useSWRInfinite #2410
Unanswered
VladimirMikulic
asked this question in
Ideas
Replies: 1 comment
-
Initiated this feature with #2728 |
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
-
Description / Observed Behavior
isLoading
only applies to the initial / first request.I have a project with many infinite scrolls and this is the line which is repeated (taken from your infinite loading example):
isLoadingMore
in this case is true while the next page data is being loaded and false otherwise:I was wondering if it would be possible to expose a property like
isLoadingMore
foruseSWRInfinite
so we avoid repeating this block for every infinite scroll in the app. Or maybe makeisLoading
to be true for all loading useSWRInfinite requests? (i.e. regardless of whether it's initial request or subsequent)Repro Steps / Code Example
https://swr.vercel.app/examples/infinite-loading
Additional Context
SWR: v2.0.3
Beta Was this translation helpful? Give feedback.
All reactions