@tanstack/react-router 0.0.1-beta.283 → 0.0.1-beta.284

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.283",
4
+ "version": "0.0.1-beta.284",
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.283"
47
+ "@tanstack/history": "0.0.1-beta.284"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js"
package/src/link.tsx CHANGED
@@ -178,7 +178,10 @@ export type SearchParamOptions<
178
178
  >
179
179
  >
180
180
  >,
181
- TFromSearchOptional = Omit<FullSearchSchema<TRouteTree>, keyof TFromSearchEnsured>,
181
+ TFromSearchOptional = Omit<
182
+ FullSearchSchema<TRouteTree>,
183
+ keyof TFromSearchEnsured
184
+ >,
182
185
  TFromSearch = Expand<TFromSearchEnsured & TFromSearchOptional>,
183
186
  TToSearch = '' extends TTo
184
187
  ? FullSearchSchema<TRouteTree>
@@ -207,15 +210,19 @@ export type PathParamOptions<
207
210
  TFromParamsOptional = Omit<AllParams<TRouteTree>, keyof TFromParamsEnsured>,
208
211
  TFromParams = Expand<TFromParamsOptional & TFromParamsEnsured>,
209
212
  TToParams = Expand<RouteByPath<TRouteTree, TTo>['types']['allParams']>,
210
- > = keyof PickRequired<TToParams> extends never
213
+ > = never extends TToParams
211
214
  ? {
212
- params?: true | ParamsReducer<TFromParams, TToParams>
213
- }
214
- : {
215
- params: TFromParamsEnsured extends PickRequired<TToParams>
216
- ? true | ParamsReducer<TFromParams, TToParams>
217
- : ParamsReducer<TFromParams, TToParams>
215
+ params?: true | ParamsReducer<Partial<TFromParams>, Partial<TFromParams>>
218
216
  }
217
+ : keyof PickRequired<TToParams> extends never
218
+ ? {
219
+ params?: true | ParamsReducer<TFromParams, TToParams>
220
+ }
221
+ : {
222
+ params: TFromParamsEnsured extends PickRequired<TToParams>
223
+ ? true | ParamsReducer<TFromParams, TToParams>
224
+ : ParamsReducer<TFromParams, TToParams>
225
+ }
219
226
 
220
227
  type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo)
221
228