T
TanStackโ€ข10mo ago
adverse-sapphire

Dynamic table with Shadcn + Tanstack Query + Tanstack Router

Hi everyone Anyone already did a dynamic table with Tanstack and Shadcn? I'm trying to build a hook to handle everything, filters, etc, but I'm facing some issues. If some one can share tips or suggestions of content please ๐Ÿ™
7 Replies
adverse-sapphire
adverse-sapphireโ€ข10mo ago
Shadcn docs has page for using TanStack table. https://ui.shadcn.com/docs/components/data-table
Data Table
Powerful table and datagrids built using TanStack Table.
adverse-sapphire
adverse-sapphireOPโ€ข10mo ago
Yes I know, but I want to do something dynamic and using server they are using filters on the frontend
adverse-sapphire
adverse-sapphireโ€ข10mo ago
For server side filters use keys on TanStack Query. queryKey: ['key', {filter: ''}] That updates table data. You don't need anything extra.
adverse-sapphire
adverse-sapphireOPโ€ข10mo ago
GitHub
tanstack-filtered-table-demo/src/hooks/useFilters.ts at main ยท Bala...
Managing table pagination, filtering and sorting on query parameters with the TanStack - Balastrong/tanstack-filtered-table-demo
adverse-sapphire
adverse-sapphireOPโ€ข10mo ago
But the search give me this erro
No description
adverse-sapphire
adverse-sapphireโ€ข10mo ago
You don't need the table to set filters... If it's a server side call, change the url params. Include them as query keys. Track the params as state. Forget the client side helpers.
adverse-sapphire
adverse-sapphireOPโ€ข10mo ago
Yes I know, but I'm trying to set the filters and the pagination on the url as query parameters but I have that error

Did you find this page helpful?