Skip to content

Implementing infinite scroll with RTK Query #1163

Answered by phryneas
davidtkramer asked this question in Q&A
Discussion options

You must be logged in to vote

Status Update, 2024-10-27

We're now actively working on a PR to implement official infinite query support!

Please see that PR for progress updates, and try it out and give us feedback!

Original Answer

Copying my answer from there over here so that people find it more easily 🙂 (also, here would be a generally better place to further discuss any upcoming problems since SO doesn't realle encourage much discussion)


I think most implementations overcomplicate the problem of "infinite scroll" by a lot.
You can achieve this by stepping a bit back and thinking about what you really need:

  • the current in-view data
  • a bit extra data into the direction we're scrolling to

Since we are lazy a…

Replies: 35 comments 149 replies

Comment options

You must be logged in to vote
17 replies
@phryneas
Comment options

@Elendil00
Comment options

@spacepolice10
Comment options

@spacepolice10
Comment options

@theobouwman
Comment options

Answer selected by davidtkramer
Comment options

You must be logged in to vote
1 reply
@phryneas
Comment options

Comment options

You must be logged in to vote
1 reply
@gormonn
Comment options

Comment options

You must be logged in to vote
9 replies
@taejs
Comment options

@phryneas
Comment options

@taejs
Comment options

@phryneas
Comment options

@skurgansky-sugarcrm
Comment options

Comment options

You must be logged in to vote
3 replies
@afgarcia86
Comment options

@afgarcia86
Comment options

@The0racle
Comment options

Comment options

You must be logged in to vote
5 replies
@phryneas
Comment options

@michalstrzelecki
Comment options

@michalstrzelecki
Comment options

@phryneas
Comment options

@mcdamo
Comment options

Comment options

You must be logged in to vote
3 replies
@kcrystalchen
Comment options

@VladyslavMartynov
Comment options

@ArtemBozhenko
Comment options

Comment options

You must be logged in to vote
2 replies
@phryneas
Comment options

@spacepolice10
Comment options

Comment options

You must be logged in to vote
21 replies
@panda919
Comment options

@adamhari
Comment options

@BenQoder
Comment options

@adamhari
Comment options

@panda919
Comment options

Comment options

You must be logged in to vote
3 replies
@BenQoder
Comment options

@Ebeldev
Comment options

@BenQoder
Comment options

Comment options

You must be logged in to vote
9 replies
@VictorPulzz
Comment options

@phryneas
Comment options

@VictorPulzz
Comment options

@phryneas
Comment options

@panda919
Comment options

Comment options

You must be logged in to vote
3 replies
@Athou
Comment options

@phryneas
Comment options

@spacepolice10
Comment options

Comment options

You must be logged in to vote
6 replies
@simenkid
Comment options

@CursedMun
Comment options

@simenkid
Comment options

@CursedMun
Comment options

@simenkid
Comment options

Comment options

You must be logged in to vote
12 replies
@AChristoff
Comment options

@phryneas
Comment options

@AChristoff
Comment options

@phryneas
Comment options

@spacepolice10
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
19 replies
@markerikson
Comment options

@JerakRus
Comment options

@markerikson
Comment options

@gentlee
Comment options

@JerakRus
Comment options

Comment options

You must be logged in to vote
2 replies
@The0racle
Comment options

@TheBoyWhoLivedd
Comment options

Comment options

You must be logged in to vote
6 replies
@panda919
Comment options

@markerikson
Comment options

@panda919
Comment options

@markerikson
Comment options

@panda919
Comment options

Comment options

You must be logged in to vote
5 replies
@firasrg
Comment options

@kiranNegiloni
Comment options

@firasrg
Comment options

@enrickdaltro
Comment options

@kiranNegiloni
Comment options

Comment options

You must be logged in to vote
1 reply
@markerikson
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mlegghl
Comment options

Comment options

You must be logged in to vote
1 reply
@P1aster
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@issam-seghir
Comment options

@Ahsanali012
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@issam-seghir
Comment options

Comment options

You must be logged in to vote
3 replies
@markerikson
Comment options

@alex-mironov
Comment options

@markerikson
Comment options

Comment options

You must be logged in to vote
1 reply
@issam-seghir
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet