@tanstack/react-router 0.0.1-beta.222 → 0.0.1-beta.224
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/Matches.js.map +1 -1
- package/build/cjs/RouterProvider.js +56 -955
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/fileRoute.js.map +1 -1
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +953 -39
- package/build/cjs/router.js.map +1 -1
- package/build/cjs/scroll-restoration.js +5 -9
- package/build/cjs/scroll-restoration.js.map +1 -1
- package/build/cjs/useSearch.js.map +1 -1
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +895 -889
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +369 -363
- package/build/types/Matches.d.ts +25 -2
- package/build/types/RouterProvider.d.ts +4 -45
- package/build/types/fileRoute.d.ts +5 -5
- package/build/types/route.d.ts +3 -1
- package/build/types/router.d.ts +50 -5
- package/build/umd/index.development.js +895 -889
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +2 -2
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.tsx +38 -2
- package/src/RouterProvider.tsx +58 -1342
- package/src/fileRoute.ts +1 -1
- package/src/route.ts +24 -1
- package/src/router.ts +1320 -45
- package/src/scroll-restoration.tsx +5 -5
- package/src/useSearch.tsx +1 -1
- package/src/utils.ts +1 -1
package/src/fileRoute.ts
CHANGED
package/src/route.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { HistoryLocation } from '@tanstack/history'
|
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
import invariant from 'tiny-invariant'
|
|
4
4
|
import { useLoaderData, useMatch } from './Matches'
|
|
5
|
-
import { AnyRouteMatch } from './
|
|
5
|
+
import { AnyRouteMatch } from './Matches'
|
|
6
6
|
import { NavigateOptions, ParsePathParams, ToSubOptions } from './link'
|
|
7
7
|
import { ParsedLocation } from './location'
|
|
8
8
|
import { joinPaths, trimPath } from './path'
|
|
@@ -178,6 +178,7 @@ type BeforeLoadFn<
|
|
|
178
178
|
location: ParsedLocation
|
|
179
179
|
navigate: NavigateFn<AnyRoute>
|
|
180
180
|
buildLocation: BuildLocationFn<AnyRoute>
|
|
181
|
+
cause: 'enter' | 'stay'
|
|
181
182
|
}) => Promise<TRouteContext> | TRouteContext | void
|
|
182
183
|
|
|
183
184
|
export type UpdatableRouteOptions<
|
|
@@ -835,3 +836,25 @@ export type PendingRouteComponent<
|
|
|
835
836
|
>
|
|
836
837
|
|
|
837
838
|
export type AnyRouteComponent = RouteComponent<any, any, any, any>
|
|
839
|
+
|
|
840
|
+
export type ComponentPropsFromRoute<TRoute> =
|
|
841
|
+
TRoute extends (() => infer T extends AnyRoute)
|
|
842
|
+
? ComponentPropsFromRoute<T>
|
|
843
|
+
: TRoute extends Route<
|
|
844
|
+
infer TParentRoute,
|
|
845
|
+
infer TPath,
|
|
846
|
+
infer TFullPath,
|
|
847
|
+
infer TCustomId,
|
|
848
|
+
infer TId,
|
|
849
|
+
infer TSearchSchema,
|
|
850
|
+
infer TFullSearchSchema,
|
|
851
|
+
infer TParams,
|
|
852
|
+
infer TAllParams,
|
|
853
|
+
infer TRouteContext,
|
|
854
|
+
infer TAllContext,
|
|
855
|
+
infer TRouterContext,
|
|
856
|
+
infer TLoaderData,
|
|
857
|
+
infer TChildren
|
|
858
|
+
>
|
|
859
|
+
? RouteProps<TFullSearchSchema, TAllParams, TAllContext, TLoaderData>
|
|
860
|
+
: {}
|