You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like the useSWR hook, useSWRInfinite has an isValidating property, which can be used to notify the user when the hook is fetching new data. Is it somehow possible to differentiate the state of when a new page is fetched (and hasn't finished yet) from when revalidation happens e.g. due to focusing the window?
I'd like to use this to show a loading indicator below my list when the user has reached a scroll position that triggers the fetching of the next page, but I don't want it to show when revalidation happens after re-focusing the window.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Like the
useSWR
hook,useSWRInfinite
has anisValidating
property, which can be used to notify the user when the hook is fetching new data. Is it somehow possible to differentiate the state of when a new page is fetched (and hasn't finished yet) from when revalidation happens e.g. due to focusing the window?I'd like to use this to show a loading indicator below my list when the user has reached a scroll position that triggers the fetching of the next page, but I don't want it to show when revalidation happens after re-focusing the window.
Many thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions