@tanstack/solid-router 1.121.40 → 1.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Match.cjs +41 -36
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/link.cjs +1 -1
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +5 -0
- package/dist/esm/Match.js +41 -36
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/link.js +1 -1
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/route.d.ts +5 -0
- package/dist/esm/route.js.map +1 -1
- package/dist/source/Match.jsx +5 -2
- package/dist/source/Match.jsx.map +1 -1
- package/dist/source/link.jsx +1 -0
- package/dist/source/link.jsx.map +1 -1
- package/dist/source/route.d.ts +5 -0
- package/dist/source/route.jsx.map +1 -1
- package/package.json +2 -2
- package/src/Match.tsx +7 -3
- package/src/link.tsx +1 -0
- package/src/route.tsx +8 -0
package/src/Match.tsx
CHANGED
|
@@ -18,7 +18,7 @@ import { matchContext } from './matchContext'
|
|
|
18
18
|
import { SafeFragment } from './SafeFragment'
|
|
19
19
|
import { renderRouteNotFound } from './renderRouteNotFound'
|
|
20
20
|
import { ScrollRestoration } from './scroll-restoration'
|
|
21
|
-
import type { AnyRoute } from '@tanstack/router-core'
|
|
21
|
+
import type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'
|
|
22
22
|
|
|
23
23
|
export const Match = (props: { matchId: string }) => {
|
|
24
24
|
const router = useRouter()
|
|
@@ -77,8 +77,12 @@ export const Match = (props: { matchId: string }) => {
|
|
|
77
77
|
},
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
+
const ShellComponent = route().isRoot
|
|
81
|
+
? ((route().options as RootRouteOptions).shellComponent ?? SafeFragment)
|
|
82
|
+
: SafeFragment
|
|
83
|
+
|
|
80
84
|
return (
|
|
81
|
-
|
|
85
|
+
<ShellComponent>
|
|
82
86
|
<matchContext.Provider value={() => props.matchId}>
|
|
83
87
|
<Dynamic
|
|
84
88
|
component={ResolvedSuspenseBoundary()}
|
|
@@ -124,7 +128,7 @@ export const Match = (props: { matchId: string }) => {
|
|
|
124
128
|
<ScrollRestoration />
|
|
125
129
|
</>
|
|
126
130
|
) : null}
|
|
127
|
-
|
|
131
|
+
</ShellComponent>
|
|
128
132
|
)
|
|
129
133
|
}
|
|
130
134
|
|
package/src/link.tsx
CHANGED
package/src/route.tsx
CHANGED
|
@@ -54,6 +54,14 @@ declare module '@tanstack/router-core' {
|
|
|
54
54
|
pendingComponent?: RouteComponent
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export interface RootRouteOptionsExtensions {
|
|
58
|
+
shellComponent?: ({
|
|
59
|
+
children,
|
|
60
|
+
}: {
|
|
61
|
+
children: Solid.JSX.Element
|
|
62
|
+
}) => Solid.JSX.Element
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
export interface RouteExtensions<
|
|
58
66
|
in out TId extends string,
|
|
59
67
|
in out TFullPath extends string,
|