useSWRInfinite on multiple pages breaks (probably I'm doing something wrong) #663
Unanswered
lazandrei19
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm working on a Next.js app and We also use SWR for data fetching. The problem I'm encountering is the following: useSWRInfinite works perfectly on /page1, but if I navigate to page2 it breaks. On the other hand, if I go directly to /page2 from my browser, it works.
By "it breaks" I mean that even though we call setSize with the new size and I have confirmed with a
console.log
thatpageCountRef.current
gets updated, https://github.com/vercel/swr/blob/master/src/use-swr-infinite.ts#L133 this still has the old valueAny suggestions please?
Beta Was this translation helpful? Give feedback.
All reactions