whats the best way to handle error state ?
i dont want to set these on every file so i put here is this correct way or wrong ?

5 Replies
foreign-sapphireOP•3y ago
@TkDodo 🔮 kindly guide me on this
flat-fuchsia•3y ago
sure
foreign-sapphireOP•3y ago
@TkDodo 🔮 ?
flat-fuchsia•3y ago
sure as in: "yes that's fine"
extended-salmon•3y ago
There is also the QueryCache https://tanstack.com/query/v4/docs/react/reference/QueryCache#global-callbacks
There are some subtle differences as noted in the docs there
QueryCache | TanStack Query Docs
The QueryCache is the storage mechanism for TanStack Query. It stores all the data, meta information and state of queries it contains.
Normally, you will not interact with the QueryCache directly and instead use the QueryClient for a specific cache.