Skip to content
public-library›Rules›TanStack Router›Throw notFound for missing resources and render it with notFoundComponent

Throw notFound for missing resources and render it with notFoundComponent

When a loader finds that the resource named by the URL does not exist, throw notFound(), not a generic error. Provide a notFoundComponent on the route or an ancestor, and a defaultNotFoundComponent on the router for everything else.

In the full rule