useQuery doesn't reload data after reset from error boundary
I have an error boundary using the help of
error.tsx
in Next.js, and when my useQuery
fails with an error, it falls back to this component. But when I hit reset, internally calling reset()
on the error component, it goes back to the same page and shows the page I render when there's no data.
My page has multiple tabs, and when this happens, even switching tabs shows no data in all of them even though I've passed tab
in the queryKey
. In one of the tabs I have a <select>
, when I change the choice in that, it does reload; and once that gets data, I start getting data everywhere else too. What? why?3 Replies
genetic-orange•12mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

ratty-blushOP•12mo ago
Not sure if I like sprinkling around these wrappers around my code :/
But I suppose it's a valid solution
Getting this either way:
I copied the code in the link to a component which takes in a children prop
Replacing
<Page />
with {children}
ratty-blushOP•12mo ago
Nevermind, this issue was me being an idiot. I was returning an empty list irrespective of the tab, that's why
