@tanstack/react-router 1.56.4 → 1.57.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.56.4",
3
+ "version": "1.57.6",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "@tanstack/react-store": "^0.5.5",
53
53
  "tiny-invariant": "^1.3.3",
54
54
  "tiny-warning": "^1.0.3",
55
- "@tanstack/history": "1.51.7"
55
+ "@tanstack/history": "1.57.6"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@testing-library/jest-dom": "^6.4.8",
@@ -66,10 +66,10 @@
66
66
  "peerDependencies": {
67
67
  "react": ">=18",
68
68
  "react-dom": ">=18",
69
- "@tanstack/router-generator": "1.56.4"
69
+ "@tanstack/router-generator": "1.57.6"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
- "@tanstack/react-router": {
72
+ "@tanstack/react-generator": {
73
73
  "optional": true
74
74
  }
75
75
  },
package/src/router.ts CHANGED
@@ -138,6 +138,7 @@ export type InferRouterContext<TRouteTree extends AnyRoute> =
138
138
  any,
139
139
  any,
140
140
  any,
141
+ any,
141
142
  any
142
143
  >
143
144
  ? TRouterContext
@@ -1815,12 +1816,16 @@ export class Router<
1815
1816
  // Reset the view transition flag
1816
1817
  delete this.shouldViewTransition
1817
1818
  // Attempt to start a view transition (or just apply the changes if we can't)
1818
- ;(shouldViewTransition && typeof document !== 'undefined'
1819
- ? document
1820
- : undefined
1821
- )
1822
- // @ts-expect-error
1823
- ?.startViewTransition?.(fn) || fn()
1819
+ if (
1820
+ shouldViewTransition &&
1821
+ typeof document !== 'undefined' &&
1822
+ 'startViewTransition' in document &&
1823
+ typeof document.startViewTransition === 'function'
1824
+ ) {
1825
+ document.startViewTransition(fn)
1826
+ } else {
1827
+ fn()
1828
+ }
1824
1829
  }
1825
1830
 
1826
1831
  updateMatch = (