Adding a new item when using useSWRInfinite #2427
Unanswered
florianwalther-private
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am building a comment system where new replies are added to the start (top) of the list. The pagination is cursor-based.
At the moment, I use
mutate
to add the newly created comment as its own page to the front of the list.:The problem is, SWR immediately starts revalidating the list and pushes the comment at the bottom out of the data set. This behavior is kind of awkward.
Is my only choice do disable automatic revalidation completely? How would you handle this?
Beta Was this translation helpful? Give feedback.
All reactions