-
Notifications
You must be signed in to change notification settings - Fork 189
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
Implement infinite scrolling without Load More button #1229
Comments
It is an interesting idea. Could I suggest another direction? Instead of watching for a scroll event, i wonder if we can do something like lazy loading that the first time only load 20 posts. and if we pass 20 posts, it loads more. I remember learning Flutter and they have something like that. Don't know if there is similar thing in React. |
This is what an |
I was waiting for this. |
As long as you aren't working on another PR at the same time (i.e., squatting on multiple Issues so other students can't get involved) go for it. |
I'm not available anymore. If someone wants to work on this issue, please go ahead. |
I am gonna try this one! |
@klee214 all yours! |
I am looking for some advice!, I am doing this right now, I could implement the infinite scrolling feature with the "more button" (Once the more button is on the viewport, the new posts are updated setSize(size + 1)). However, it seems hard to do this without the "more button" component for 2 reasons, |
We're using |
Closes #1229: Implement infinite scrolling without Load More button
We used to have an implementation of infinite scrolling that almost worked, but we replaced it with a manual "Load More..." button. In #1217 I moved us to using paged data and the
useSWRInfinite()
hook, and we could use that to implement infinite scrolling with anIntersectionObserver
, see discussion in https://sergiodxa.com/articles/swr/pagination. I think all we'd need to do is listen for the scroll event and then callsetSize(size + 1)
there vs. in theonClick
for the LoadMore button.The text was updated successfully, but these errors were encountered: