TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

`notFoundComponent` doesn't render when `notFound` is thrown in the loader since 1.28.2 #1551

Open GuillaumeLaroucheUQAT opened 2 weeks ago

GuillaumeLaroucheUQAT commented 2 weeks ago

Describe the bug

A route wrapped in Suspense either by setting the prop wrapInSuspense to true or defining a pendingComponent doesn't render the notFoundComponent or the defaultNotFoundComopnent when the notFound function is thrown in the loader.

Your Example Website or App

https://codesandbox.io/p/devbox/beautiful-archimedes-7vwmwj

Steps to Reproduce the Bug or Issue

To reproduce :

  1. Go to index route
  2. Loading is rendered instead of Not found

Things that doesn't trigger the bug :

Expected behavior

The prop notFoundComponent should be rendered when the notFound function is thrown in the loader even if the route is wrapped in Suspense and the Promise is taking longer to resolve.

Screenshots or Videos

No response

Platform

Additional context

No response

kcoet commented 5 days ago

router.hasNotFoundMatch() also always returns false, I think this is related.