onError global cache-level callbacks
Hi !
How can I prevent a component that throws an error from using the global onError? In other words, how can we avoid the global onError from executing sometimes?

5 Replies
fair-rose•3y ago
use the meta and check it there
fair-rose•3y ago
it'll always run, but you can decide to not show a toast in there ?
protestant-coralOP•3y ago
yes I mean how to implement a mechanism where in some cases, I won't want to display the toast.
fair-rose•3y ago
the
meta option as shown in the post?
https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose#defining-on-demand-messagesBreaking React Query's API on purpose
Why good API design matters, even if it means breaking existing APIs in the face of resistance.
protestant-coralOP•3y ago
Thanks Thanks !!! 🙂 ! have a good day !