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
and in each of these pages, setSize() is used depending on context.
Issue
Let's say pageA's feed size is set to 3 after some scrolling. Then I navigate from pageA to pageB, feedB is loaded and back to pageA. Initially, pageA's scroll position is preserved (done via next-router-scroll). But after a few moments, pageA's feed data changes as if feed size is set to 1 and not 3, like it was before navigating.
I tried persistSize: false in option, but doesn't seem to work. I want to persist page sizes when nagivating between different pages using useFeed hook.
Current Working Solution (hacky?)
I tried preserving the feed size in URL params as /pageA?p={size} every time size is changed via setSize.
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.
-
Context
I have few pages that that use a custom
useSWRInfinite
hookWith the options
And I use in different pages as follows
and in each of these pages, setSize() is used depending on context.
Issue
Let's say pageA's feed size is set to 3 after some scrolling. Then I navigate from pageA to pageB,
feedB
is loaded and back to pageA. Initially, pageA's scroll position is preserved (done via next-router-scroll). But after a few moments, pageA's feed data changes as if feed size is set to 1 and not 3, like it was before navigating.I tried
persistSize: false
inoption
, but doesn't seem to work. I want to persist page sizes when nagivating between different pages usinguseFeed
hook.Current Working Solution (hacky?)
I tried preserving the feed size in URL params as
/pageA?p={size}
every time size is changed via setSize.And setSize(p) on router change so when navigating back to pageA the last size is set
This works as expected but feels hacky. Is there a better way to solve this issue? What am I missing? How do I achieve the desired effect?
Beta Was this translation helpful? Give feedback.
All reactions