TanStackT
TanStack5mo ago
6 replies
worthy-azure

errorComponent not rendering

Hi Guys. Hope you are all good.
I have a
notFoundComponent
and errorComponent defined for a layout with some child routes defined in route.tsx. The
notFoundComponent
is getting rendered correctly when a route is not found but when an error occurs within those child routes, instead of rendering errorComponent, it's rendering defaultErrorComponent defined in router.tsx which is not the behavior I am expecting. Is this the correct behavior or I am missing something?
Was this page helpful?