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.27k stars 495 forks source link

PendingComponent isn't shown while beforeLoad is pending on root route #1601

Closed freshgiammi closed 2 weeks ago

freshgiammi commented 2 weeks ago

Describe the bug

Since 1.31.28, PendingComponent on the root route isn't shown while beforeLoad is pending. This looks like it was introduced by https://github.com/TanStack/router/commit/854e52226d4c9241ce787dd82fc69c3e19c57a1a#diff-4cfd6abe2272d72c1dd073ec37936ad823bcd1f9418b466a9dea8b50214448f8R186. Instead, a white page is shown as nothing gets mounted.

Your Example Website or App

https://stackblitz.com/edit/github-khgssk-d8fyff

Steps to Reproduce the Bug or Issue

  1. Open app
  2. Wait for root beforeLoad to resolve
  3. Observe that the pendingComponent is never shown

Expected behavior

PendingComponent should be shown.

Screenshots or Videos

No response

Platform

Additional context

No response