Skip to content

Root route component is rendered for non-matching-route path but not for missing resource #2255

Open
@lo1tuma

Description

@lo1tuma

Which project does this relate to?

Router

Describe the bug

The component defined in the rootRoute is rendered when a non-matching path riggers the rendering of the notFoundComponent but it is not rendered when a child route trows a notFound() value in its loader.

Your Example Website or App

https://stackblitz.com/edit/github-yk78pg-lfpyxu?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  • define a root route with component and notFoundComponent
  • navigate to a non-matching path
  • -> the component as well as the notFoundComponent gets rendered

Expected behavior

I would expect the behavior to be the same in both scenarios.

Screenshots or Videos

No response

Platform

  • Version: 1.52.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions