Pagination: placeholderData not working
Hey guys! I am just playing around with @tanstack/react-table and pagination and got the problem, that after switching the page, for a short time, I'll get "No results". I'll found this doc-page, which seems to cover exactly this problem: https://tanstack.com/query/latest/docs/framework/react/guides/paginated-queries
hovever, for some reason, I'll still get the flickering with
placeholderData: keepPreviousData. What could be the Problem? I attach my two components here. Anyone knows, what my Problem could be?
Page (data fetching): https://just-paste.it/jSfMtm16Et,
Table: https://just-paste.it/pyL87PSroQPaginated / Lagged Queries | TanStack Query React Docs
Rendering paginated data is a very common UI pattern and in TanStack Query, it "just works" by including the page information in the query key:
6 Replies
other-emeraldOP•8mo ago
bump
rival-black•8mo ago
Hey can you create a small playground to reproduce your issue, it will be much more easier for us ;)
other-emeraldOP•8mo ago
GitHub
GitHub - Kaseax/react-table-pagination-flicker: minimal reproductio...
minimal reproduction issue for pagination flickering - not well formatted, just a basic project - Kaseax/react-table-pagination-flicker
rival-black•8mo ago
Hey, if I remove
getPaginationRowModel: getPaginationRowModel(), it's working well are you sure you need this?other-emeraldOP•8mo ago
that seemed to fix it, thanks!
rival-black•8mo ago
no worries 👍