onError does not trigger
Simple repro in
about.tsx: https://stackblitz.com/edit/tanstack-router-meaitd?file=src%2Froutes%2F__root.tsx,src%2Froutes%2Fabout.tsx,src%2Froutes%2Findex.tsx
onError never seems to be called.StackBlitz
Error Repro: onError not triggering - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
2 Replies
like-gold•2y ago
see the docs: https://tanstack.com/router/v1/docs/framework/react/api/router/RouteOptionsType#onerror-property
A function that will be called when an error is thrown during a navigation or preload event.it is triggered e.g. when the error is thrown in a beforeLoad function: https://stackblitz.com/edit/tanstack-router-1v5pjk?file=src%2Froutes%2Fabout.tsx
RouteOptions type | TanStack Router Docs
The RouteOptions type is used to describe the options that can be used when creating a route.
RouteOptions properties
like-gold•2y ago
it is not triggered when you react component throws