@tanstack/react-router 1.51.5 → 1.51.7
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/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/router.cjs +5 -8
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +0 -1
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/router.d.ts +0 -1
- package/dist/esm/router.js +5 -8
- package/dist/esm/router.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.tsx +1 -5
- package/src/router.ts +6 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
|
-
"version": "1.51.
|
|
3
|
+
"version": "1.51.7",
|
|
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.
|
|
55
|
+
"@tanstack/history": "1.51.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/jest-dom": "^6.4.8",
|
package/src/Matches.tsx
CHANGED
|
@@ -4,14 +4,10 @@ import { CatchBoundary, ErrorComponent } from './CatchBoundary'
|
|
|
4
4
|
import { useRouterState } from './useRouterState'
|
|
5
5
|
import { useRouter } from './useRouter'
|
|
6
6
|
import { Transitioner } from './Transitioner'
|
|
7
|
-
import {
|
|
8
|
-
type AnyRoute,
|
|
9
|
-
type ReactNode,
|
|
10
|
-
type StaticDataRouteOption,
|
|
11
|
-
} from './route'
|
|
12
7
|
import { matchContext } from './matchContext'
|
|
13
8
|
import { Match } from './Match'
|
|
14
9
|
import { SafeFragment } from './SafeFragment'
|
|
10
|
+
import type { AnyRoute, ReactNode, StaticDataRouteOption } from './route'
|
|
15
11
|
import type { AnyRouter, RegisteredRouter } from './router'
|
|
16
12
|
import type { ResolveRelativePath, ToOptions } from './link'
|
|
17
13
|
import type {
|
package/src/router.ts
CHANGED
|
@@ -492,7 +492,6 @@ export interface BuildNextOptions {
|
|
|
492
492
|
unmaskOnReload?: boolean
|
|
493
493
|
}
|
|
494
494
|
from?: string
|
|
495
|
-
fromSearch?: unknown
|
|
496
495
|
_fromLocation?: ParsedLocation
|
|
497
496
|
}
|
|
498
497
|
|
|
@@ -1304,13 +1303,9 @@ export class Router<
|
|
|
1304
1303
|
} = {},
|
|
1305
1304
|
matches?: Array<MakeRouteMatch<TRouteTree>>,
|
|
1306
1305
|
): ParsedLocation => {
|
|
1307
|
-
const fromMatches =
|
|
1308
|
-
dest._fromLocation
|
|
1309
|
-
|
|
1310
|
-
...dest._fromLocation,
|
|
1311
|
-
search: dest.fromSearch || dest._fromLocation.search,
|
|
1312
|
-
})
|
|
1313
|
-
: this.state.matches
|
|
1306
|
+
const fromMatches = dest._fromLocation
|
|
1307
|
+
? this.matchRoutes(dest._fromLocation)
|
|
1308
|
+
: this.state.matches
|
|
1314
1309
|
|
|
1315
1310
|
const fromMatch =
|
|
1316
1311
|
dest.from != null
|
|
@@ -1330,7 +1325,9 @@ export class Router<
|
|
|
1330
1325
|
'Could not find match for from: ' + dest.from,
|
|
1331
1326
|
)
|
|
1332
1327
|
|
|
1333
|
-
const fromSearch =
|
|
1328
|
+
const fromSearch = this.state.pendingMatches
|
|
1329
|
+
? last(this.state.pendingMatches)?.search
|
|
1330
|
+
: last(fromMatches)?.search || this.latestLocation.search
|
|
1334
1331
|
|
|
1335
1332
|
const stayingMatches = matches?.filter((d) =>
|
|
1336
1333
|
fromMatches.find((e) => e.routeId === d.routeId),
|