@tanstack/react-router 0.0.1-beta.275 → 0.0.1-beta.276

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.275",
4
+ "version": "0.0.1-beta.276",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -44,7 +44,7 @@
44
44
  "@tanstack/store": "^0.1.3",
45
45
  "tiny-invariant": "^1.3.1",
46
46
  "tiny-warning": "^1.0.3",
47
- "@tanstack/history": "0.0.1-beta.275"
47
+ "@tanstack/history": "0.0.1-beta.276"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js"
@@ -49,7 +49,7 @@ export type MatchRouteFn<TRouteTree extends AnyRoute> = <
49
49
  ) => false | RouteById<TRouteTree, TResolved>['types']['allParams']
50
50
 
51
51
  export type BuildLocationFn<TRouteTree extends AnyRoute> = (
52
- opts: BuildNextOptions,
52
+ opts: ToOptions<TRouteTree>,
53
53
  ) => ParsedLocation
54
54
 
55
55
  export type InjectedHtmlEntry = string | (() => Promise<string> | string)
package/src/route.ts CHANGED
@@ -169,7 +169,7 @@ type BeforeLoadFn<
169
169
  context: TParentRoute['types']['allContext']
170
170
  location: ParsedLocation
171
171
  navigate: NavigateFn<AnyRoute>
172
- buildLocation: BuildLocationFn<AnyRoute>
172
+ buildLocation: BuildLocationFn<TParentRoute>
173
173
  cause: 'preload' | 'enter' | 'stay'
174
174
  }) => Promise<TRouteContext> | TRouteContext | void
175
175
 
package/src/router.ts CHANGED
@@ -59,6 +59,7 @@ import {
59
59
  } from './path'
60
60
  import invariant from 'tiny-invariant'
61
61
  import { isRedirect } from './redirects'
62
+ import { ToOptions } from './link'
62
63
  // import warning from 'tiny-warning'
63
64
 
64
65
  //
@@ -937,7 +938,7 @@ export class Router<
937
938
  startTransition,
938
939
  ...rest
939
940
  }: BuildNextOptions & CommitLocationOptions = {}) => {
940
- const location = this.buildLocation(rest)
941
+ const location = this.buildLocation(rest as any)
941
942
  return this.commitLocation({
942
943
  ...location,
943
944
  startTransition,
@@ -1461,9 +1462,9 @@ export class Router<
1461
1462
  }
1462
1463
 
1463
1464
  preloadRoute = async (
1464
- navigateOpts: BuildNextOptions = this.state.location,
1465
+ navigateOpts: ToOptions<TRouteTree> = this.state.location as any,
1465
1466
  ) => {
1466
- let next = this.buildLocation(navigateOpts)
1467
+ let next = this.buildLocation(navigateOpts as any)
1467
1468
 
1468
1469
  let matches = this.matchRoutes(next.pathname, next.search, {
1469
1470
  throwOnError: true,