T
TanStack2y ago
xenial-black

onError does not trigger

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
like-gold2y 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
like-gold2y ago
it is not triggered when you react component throws

Did you find this page helpful?