Skip to content

throwing notFound() in loader renders the defaultNotFoundComponent, even when a notFoundComponent exists in __root__ #4078

Description

@anthonyma94

Which project does this relate to?

Router

Describe the bug

When throwing notFound() in a loader function, the not found component is always the defaultNotFoundComponent, even when notFoundComponent is assigned in __root__. This applies even if you use notFound({ routeId: rootRouteId }).

Your Example Website or App

https://stackblitz.com/edit/github-51knrjza?file=src%2Froutes%2Fabout.tsx

Steps to Reproduce the Bug or Issue

Go to the about page.

Expected behavior

notFound should follow the default not found rules.

Screenshots or Videos

No response

Platform

  • OS: WSL
  • Browser: Firefox
  • Version: 1.114.27

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions