How to Handle notFound() Globally Instead of Checking 404 in Each Loader?
Instead of checking for a 404 status and throwing the notFound() function in each loader separately, can I handle it in one place? For example, in the onError handler of React Query’s QueryCache or in an Axios response interceptor?
I’m trying to implement this as shown in the screenshots, but I’m still encountering an error, as you can see in the screenshots.



1 Reply
exotic-emerald•7mo ago
ideally provide this a a complete minimal example by forking one of the existing examples on stackblitz
are you sure the error is thrown inside the loader and not from the component?