How to nested a 404 and 500 page?
Hi everyone, I'm working with TanStack Router and trying to implement different 404 and 500 error pages for different layouts. I have a
My goal is to have a specific 404 page rendered when a route under the
Currently, I've tried defining a
Here's my route structure for context:
here is my route
Is there a specific way to achieve this nested 404 behavior? I'm assuming the
__root.tsx layout and a _protected.tsx layout.My goal is to have a specific 404 page rendered when a route under the
_protected layout is not found, without falling back to the 404 defined in __root.tsx.Currently, I've tried defining a
notFoundComponent within _protected.tsx. However, when I navigate to a non-existent route within the _protected layout, it always renders the notFoundComponent defined in __root.tsx instead.Here's my route structure for context:
here is my route
Is there a specific way to achieve this nested 404 behavior? I'm assuming the
notFoundComponent in _protected.tsx should override the root one for routes under that layout, but it's not working as expected. Any ideas on what I might be missing or how to correctly implement this?"