TanStackT
TanStack12mo ago
3 replies
rubber-blue

How to access query key above its scope?

I have a page component that renders a list (deeply nested). The list has a dynamic query key that changes once the user interacts with the different filters. I want to access the ever-changing query key above the scope of the list component, so I can read the query state and act on it (show/hide components accordingly). Is there a way to do that without maintaining unique ids? for example, the list will have an id like so: ["main-list", ...otherKeys], another query will be ["sidebar-list", ...otherKeys] etc'.
Was this page helpful?