You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use my own loading component at the root level. To do that I'm wrapping the <Outlet> in the root component with a <Suspense> block. Unfortunately, Outlet wraps the children in a <Suspense> block of its own, preventing mine from being used. Since I have no defaultPendingComponent configured, it renders nothing.
Although, I'm still of the opinion that if no pending components are configured, the router shouldn't wrap anything in a suspense at all. I don't think rendering a suspense with null as fallback is a good default.
Describe the bug
I would like to use my own loading component at the root level. To do that I'm wrapping the
<Outlet>
in the root component with a<Suspense>
block. Unfortunately,Outlet
wraps the children in a<Suspense>
block of its own, preventing mine from being used. Since I have nodefaultPendingComponent
configured, it renders nothing.I have traced the issue to this part of the code:
router/packages/react-router/src/Match.tsx
Lines 294 to 302 in f7c74bc
Your Example Website or App
https://stackblitz.com/edit/github-s38jue?file=src%2Froutes%2F__root.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
As a user, I expect to see the fallback content
Suspense fallback - I expect this to show up
, but I'm seeing nothing (besides the navigation)Screenshots or Videos
No response
Platform
Additional context
Related issue: #1049
The text was updated successfully, but these errors were encountered: