@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/src/fileRoute.ts CHANGED
@@ -108,7 +108,7 @@ export class FileRoute<
108
108
  TChildren extends RouteConstraints['TChildren'] = unknown,
109
109
  TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute,
110
110
  >(
111
- options: Omit<
111
+ options?: Omit<
112
112
  RouteOptions<
113
113
  TParentRoute,
114
114
  string,
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 './RouterProvider'
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
+ : {}