T
TanStack8mo ago
other-emerald

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/pyL87PSroQ
Paginated / 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-emerald
other-emeraldOP8mo ago
bump
rival-black
rival-black8mo ago
Hey can you create a small playground to reproduce your issue, it will be much more easier for us ;)
other-emerald
other-emeraldOP8mo 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
rival-black8mo ago
Hey, if I remove getPaginationRowModel: getPaginationRowModel(), it's working well are you sure you need this?
other-emerald
other-emeraldOP8mo ago
that seemed to fix it, thanks!
rival-black
rival-black8mo ago
no worries 👍

Did you find this page helpful?