@tanstack/react-router 1.162.8 → 1.163.2

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.
@@ -4289,6 +4289,27 @@ type ToOptions<
4289
4289
  state?:
4290
4290
  | Record<string, any>
4291
4291
  | ((prevState: Record<string, unknown>) => Record<string, unknown>)
4292
+ // \`mask\` is another navigation object used to mask the URL shown in the browser for this navigation.
4293
+ mask?: ToMaskOptions<TRouteTree>
4294
+ }
4295
+
4296
+ type ToMaskOptions<TRouteTree extends AnyRoute = AnyRoute> = {
4297
+ // \`from\`, \`to\`, \`params\`, \`search\`, \`hash\`, and \`state\` behave the same as in \`ToOptions\`.
4298
+ // \`mask\` itself is not allowed inside \`ToMaskOptions\`.
4299
+ from?: string
4300
+ to: string
4301
+ params:
4302
+ | Record<string, unknown>
4303
+ | ((prevParams: Record<string, unknown>) => Record<string, unknown>)
4304
+ search:
4305
+ | Record<string, unknown>
4306
+ | ((prevSearch: Record<string, unknown>) => Record<string, unknown>)
4307
+ hash?: string | ((prevHash: string) => string)
4308
+ state?:
4309
+ | Record<string, any>
4310
+ | ((prevState: Record<string, unknown>) => Record<string, unknown>)
4311
+ // If true, the URL will unmask on page reload.
4312
+ unmaskOnReload?: boolean
4292
4313
  }
4293
4314
  \`\`\`
4294
4315
 
@@ -4329,6 +4350,8 @@ export type NavigateOptions<
4329
4350
  }
4330
4351
  \`\`\`
4331
4352
 
4353
+ \`NavigateOptions\` includes all \`ToOptions\` fields, including \`mask\`.
4354
+
4332
4355
  ### \`LinkOptions\` Interface
4333
4356
 
4334
4357
  Anywhere an actual \`<a>\` tag the \`LinkOptions\` interface which extends \`NavigateOptions\` will be available:
@@ -4357,6 +4380,8 @@ export type LinkOptions<
4357
4380
  }
4358
4381
  \`\`\`
4359
4382
 
4383
+ Since \`LinkOptions\` extends \`NavigateOptions\`, it also supports \`mask\`.
4384
+
4360
4385
  ## Navigation API
4361
4386
 
4362
4387
  With relative navigation and all of the interfaces in mind now, let's talk about the different flavors of navigation API at your disposal:
@@ -5703,7 +5728,7 @@ You can also combine suffixes with wildcards for more complex routing patterns:
5703
5728
  # React
5704
5729
 
5705
5730
  \`\`\`tsx title="src/routes/files/{$}[.]txt.tsx"
5706
- export const Route = createFileRoute('/files/{$fileName}[.]txt')({
5731
+ export const Route = createFileRoute('/files/{$}.txt')({
5707
5732
  component: FileComponent,
5708
5733
  })
5709
5734
 
@@ -5717,7 +5742,7 @@ function FileComponent() {
5717
5742
  # Solid
5718
5743
 
5719
5744
  \`\`\`tsx title="src/routes/files/{$}[.]txt.tsx"
5720
- export const Route = createFileRoute('/files/{$fileName}[.]txt')({
5745
+ export const Route = createFileRoute('/files/{$}.txt')({
5721
5746
  component: FileComponent,
5722
5747
  })
5723
5748
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.162.8",
3
+ "version": "1.163.2",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  "tiny-invariant": "^1.3.3",
83
83
  "tiny-warning": "^1.0.3",
84
84
  "@tanstack/history": "1.161.4",
85
- "@tanstack/router-core": "1.162.6"
85
+ "@tanstack/router-core": "1.163.2"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@testing-library/jest-dom": "^6.6.3",
package/src/link.tsx CHANGED
@@ -661,7 +661,7 @@ export function useLinkProps<
661
661
  }
662
662
 
663
663
  const enqueueIntentPreload = (e: React.MouseEvent | React.FocusEvent) => {
664
- if (disabled || !preload) return
664
+ if (disabled || preload !== 'intent') return
665
665
 
666
666
  if (!preloadDelay) {
667
667
  doPreload()
@@ -682,7 +682,7 @@ export function useLinkProps<
682
682
  }
683
683
 
684
684
  const handleTouchStart = (_: React.TouchEvent) => {
685
- if (disabled || !preload) return
685
+ if (disabled || preload !== 'intent') return
686
686
  doPreload()
687
687
  }
688
688