Error boundary does not seem to reset suspense query properly when leaving the page with the error.
Lets say Page2 executes useSuspenseQuery that fail. The query is rendered inside Suspense, ErrorBoundary and QueryErrorResetBoundary inside the Page2.
Steps
- Navigating to Page2
- Loading state on Suspense
- Error occurred on suspense query
- Rendered Fallback on error boundary
- Inside fallback we automatically navigate to Page1
- on Fallback unmount, we reset error boundary and query
- when navigate on Page2 again the query is not re executed
Code sandbox provided.
https://codesandbox.io/p/sandbox/infallible-worker-kx3f84?file=%2Fsrc%2FApp.js
Steps
- Navigating to Page2
- Loading state on Suspense
- Error occurred on suspense query
- Rendered Fallback on error boundary
- Inside fallback we automatically navigate to Page1
- on Fallback unmount, we reset error boundary and query
- when navigate on Page2 again the query is not re executed
Code sandbox provided.
https://codesandbox.io/p/sandbox/infallible-worker-kx3f84?file=%2Fsrc%2FApp.js