@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/build/cjs/packages/router-core/src/router.js +2 -2
- package/build/cjs/packages/router-core/src/router.js.map +1 -1
- package/build/esm/index.js +2 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +128 -128
- package/build/types/index.d.ts +2 -0
- package/build/umd/index.development.js +2 -2
- 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 +1 -1
- package/src/link.ts +3 -1
- package/src/router.ts +2 -0
package/package.json
CHANGED
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 {
|