Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non isolated behavior in multiple useSWRInfinite with same URL #4098

Open
ddoice opened this issue Feb 19, 2025 · 1 comment
Open

Non isolated behavior in multiple useSWRInfinite with same URL #4098

ddoice opened this issue Feb 19, 2025 · 1 comment

Comments

@ddoice
Copy link

ddoice commented Feb 19, 2025

Bug report

Hey everyone, first of all, thank you for this great library.
I'm using it on a website that requires infinite scroll for items with the same initial URL.
Unfortunately, setSize changes the size for both instances, but I need them to be isolated.

Some of the views react to user actions and need to add/remove items, and this behavior should only occur in that specific view, not on all of them.

Image

Description / Observed Behavior

Can't use useSWRInfinite more than once with the same initial URL.

Expected Behavior

Be able to use it multiple times with the same initial URL, and for each instance to behave in isolation.

Repro Steps / Code Example

Example

Additional Context

SWR version 2.3.2

@ddoice ddoice changed the title Non Isolated Behavior in multiple useSWRInfinite with Same URL Non Isolated Behavior in multiple useSWRInfinite with same URL Feb 19, 2025
@ddoice ddoice changed the title Non Isolated Behavior in multiple useSWRInfinite with same URL Non isolated behavior in multiple useSWRInfinite with same URL Feb 19, 2025
@ddoice
Copy link
Author

ddoice commented Feb 19, 2025

Duplicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant