@tanstack/router-core 0.0.1-beta.15 → 0.0.1-beta.16

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/router-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.15",
4
+ "version": "0.0.1-beta.16",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
package/src/link.ts CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  DefaultAllRouteInfo,
5
5
  RouteInfoByPath,
6
6
  } from './routeInfo'
7
- import { Location } from './router'
7
+ import { Location, LocationState } from './router'
8
8
  import { Expand, NoInfer, PickAsRequired, PickRequired, Updater } from './utils'
9
9
 
10
10
  export type LinkInfo =
@@ -126,6 +126,8 @@ export type ToOptions<
126
126
  to?: ToPathOption<TAllRouteInfo, TFrom, TTo>
127
127
  // The new has string or a function to update it
128
128
  hash?: Updater<string>
129
+ // State to pass to the history stack
130
+ state?: LocationState
129
131
  // The source route path. This is automatically set when using route-level APIs, but for type-safe relative routing on the router itself, this is required
130
132
  from?: TFrom
131
133
  // // When using relative route paths, this option forces resolution from the current path, instead of the route API's path or `from` path
package/src/router.ts CHANGED
@@ -199,6 +199,7 @@ export interface BuildNextOptions {
199
199
  params?: true | Updater<Record<string, any>>
200
200
  search?: true | Updater<unknown>
201
201
  hash?: true | Updater<string>
202
+ state?: LocationState
202
203
  key?: string
203
204
  from?: string
204
205
  fromCurrent?: boolean
@@ -1258,6 +1259,7 @@ export function createRouter<
1258
1259
  },
1259
1260
  {
1260
1261
  id,
1262
+ ...next.state,
1261
1263
  },
1262
1264
  )
1263
1265
  } else {