@tanstack/react-router 0.0.1-beta.208 → 0.0.1-beta.209
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/build/cjs/RouterProvider.js +14 -14
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/fileRoute.js.map +1 -1
- package/build/cjs/index.js +2 -2
- package/build/cjs/react.js +7 -7
- package/build/cjs/react.js.map +1 -1
- package/build/cjs/route.js +6 -13
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +1 -1
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +27 -34
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +170 -170
- package/build/types/RouteMatch.d.ts +1 -1
- package/build/types/fileRoute.d.ts +17 -2
- package/build/types/react.d.ts +4 -4
- package/build/types/route.d.ts +42 -38
- package/build/types/router.d.ts +5 -5
- package/build/umd/index.development.js +28 -35
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/RouteMatch.ts +1 -1
- package/src/RouterProvider.tsx +15 -15
- package/src/fileRoute.ts +10 -8
- package/src/react.tsx +13 -11
- package/src/route.ts +108 -105
- package/src/router.ts +6 -6
package/src/router.ts
CHANGED
|
@@ -50,12 +50,12 @@ export type HydrationCtx = {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export type RouterContextOptions<TRouteTree extends AnyRoute> =
|
|
53
|
-
AnyContext extends TRouteTree['types']['
|
|
53
|
+
AnyContext extends TRouteTree['types']['routerContext']
|
|
54
54
|
? {
|
|
55
|
-
|
|
55
|
+
context?: TRouteTree['types']['routerContext']
|
|
56
56
|
}
|
|
57
57
|
: {
|
|
58
|
-
|
|
58
|
+
context: TRouteTree['types']['routerContext']
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export interface RouterOptions<
|
|
@@ -85,7 +85,7 @@ export interface RouterOptions<
|
|
|
85
85
|
routeTree?: TRouteTree
|
|
86
86
|
basepath?: string
|
|
87
87
|
createRoute?: (opts: { route: AnyRoute; router: AnyRouter }) => void
|
|
88
|
-
|
|
88
|
+
context?: TRouteTree['types']['routerContext']
|
|
89
89
|
// dehydrate?: () => TDehydrated
|
|
90
90
|
// hydrate?: (dehydrated: TDehydrated) => void
|
|
91
91
|
routeMasks?: RouteMask<TRouteTree>[]
|
|
@@ -174,7 +174,7 @@ export class Router<
|
|
|
174
174
|
> {
|
|
175
175
|
options: PickAsRequired<
|
|
176
176
|
RouterOptions<TRouteTree, TDehydrated>,
|
|
177
|
-
'stringifySearch' | 'parseSearch' | '
|
|
177
|
+
'stringifySearch' | 'parseSearch' | 'context'
|
|
178
178
|
>
|
|
179
179
|
routeTree: TRouteTree
|
|
180
180
|
// dehydratedData?: TDehydrated
|
|
@@ -184,7 +184,7 @@ export class Router<
|
|
|
184
184
|
constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>) {
|
|
185
185
|
this.options = {
|
|
186
186
|
defaultPreloadDelay: 50,
|
|
187
|
-
|
|
187
|
+
context: undefined!,
|
|
188
188
|
...options,
|
|
189
189
|
stringifySearch: options?.stringifySearch ?? defaultStringifySearch,
|
|
190
190
|
parseSearch: options?.parseSearch ?? defaultParseSearch,
|