TanStackT
TanStack8mo ago
6 replies
dead-brown

Multiple table search params

How should I handle multiple independent table search params on a single page (some synced to URL, some not)?

I have a page with 5 different tables. Each table has its own filters, sorting, and pagination. Some of these tables should sync their state (e.g. page number, filters) to the URL via search params, while others should keep state internally without touching the URL.

I read through this TanStack blog post https://tanstack.com/blog/search-params-are-state, which is helpful conceptually, but it doesn’t make it clear how to handle multiple independent state slices that may or may not persist to the URL.

What would be a good pattern or approach to:
• Namespace search params so each table can manage its own without collision
• Allow each table to optionally sync to the URL or stay local
• Update search params partially, without affecting unrelated table states

Has anyone dealt with this kind of hybrid setup before? Would love to hear examples, patterns, or custom hook ideas that scale well.
Was this page helpful?