You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What if i don't use "useErrorBoundaries" in defaultQueryOptions?
My app always crash on the first mount when calling useAuth. The query returns 401 on the first fetch and it throws an error and crash the app. I already have axios interceptors built as a component wrapper to catch the 401. That doesn't solve the problem either. So i turned off the "useErrorBoundaries" and problem solved. But i wonder what kind of disadvantage i get when i deactivate the useErrorBoundaries. As far as i know, ErrorBoundary component is supposed to handle rendering error. Do we need react-error-boundary to handle server state error? I could've just navigate the page to login page if the user is unauthenticated
The text was updated successfully, but these errors were encountered:
galih56
changed the title
What if i don't use "useErrorBoundaries" in defaultQueryOptions?
How to handle axios + react-query errors?
Feb 12, 2023
galih56
changed the title
How to handle axios + react-query errors?
React-query + axios errors trigger app crash with react-error-boundary
Feb 12, 2023
What if i don't use "useErrorBoundaries" in defaultQueryOptions?
My app always crash on the first mount when calling useAuth. The query returns 401 on the first fetch and it throws an error and crash the app. I already have axios interceptors built as a component wrapper to catch the 401. That doesn't solve the problem either. So i turned off the "useErrorBoundaries" and problem solved. But i wonder what kind of disadvantage i get when i deactivate the useErrorBoundaries. As far as i know, ErrorBoundary component is supposed to handle rendering error. Do we need react-error-boundary to handle server state error? I could've just navigate the page to login page if the user is unauthenticated
Any another ideas to solve this issue?
authentication functions
https://github.com/galih56/manpro-v2/blob/dev/resources/js/lib/authentication.tsx
Axios interceptor wrapper
https://github.com/galih56/manpro-v2/blob/dev/resources/js/lib/axios.tsx
The text was updated successfully, but these errors were encountered: