Skip to content
Source
Sign inSign up
TanStack/router

fix(react-router,solid-router): top-level `Matches` should use `pendingComponent` on root route #5495

MergedTkDodomerged 8 commits intomain fromrefs/pull/5495/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 4 changed files with 35 additions and 8 deletions (loading 1).

x
0 of 4 viewed, 4 left
7 additions and 3 deletionspackages/react-router/src/Matches.tsxModified
View file
@@ -1,5 +1,6 @@
import * as React from 'react'
import warning from 'tiny-warning'
+import { rootRouteId } from '@tanstack/router-core'
import { CatchBoundary, ErrorComponent } from './CatchBoundary'
import { useRouterState } from './useRouterState'
import { useRouter } from './useRouter'
@@ -12,6 +13,7 @@
ValidateSelected,
} from './structuralSharing'
import type {
+ AnyRoute,
AnyRouter,
DeepPartial,
Expand,
@@ -41,11 +43,13 @@
​
export function Matches() {
const router = useRouter()
+ const rootRoute: AnyRoute = router.routesById[rootRouteId]
​
- const pendingElement = router.options.defaultPendingComponent ? (
- <router.options.defaultPendingComponent />
- ) : null