@tanstack/react-router 1.151.6 → 1.153.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.
- package/dist/cjs/Transitioner.cjs +8 -1
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/esm/Transitioner.js +8 -1
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/llms/rules/guide.d.ts +1 -1
- package/dist/llms/rules/guide.js +10 -0
- package/package.json +3 -3
- package/src/Transitioner.tsx +12 -1
package/dist/llms/rules/guide.js
CHANGED
|
@@ -3529,6 +3529,16 @@ const link = (
|
|
|
3529
3529
|
)
|
|
3530
3530
|
\`\`\`
|
|
3531
3531
|
|
|
3532
|
+
> ⚠️ When directly navigating to a URL with a hash fragment, the fragment is only available on the client; the browser does not send the fragment to the server as part of the request URL.
|
|
3533
|
+
>
|
|
3534
|
+
> This means that if you are using a server-side rendering approach, the hash fragment will not be available on the server-side, and hydration mismatches can occur when using the hash for rendering markup.
|
|
3535
|
+
>
|
|
3536
|
+
> Examples of this would be:
|
|
3537
|
+
>
|
|
3538
|
+
> - returning the hash value in the markup,
|
|
3539
|
+
> - conditional rendering based on the hash value, or
|
|
3540
|
+
> - setting the Link as active based on the hash value.
|
|
3541
|
+
|
|
3532
3542
|
### Navigating with Optional Parameters
|
|
3533
3543
|
|
|
3534
3544
|
Optional path parameters provide flexible navigation patterns where you can include or omit parameters as needed. Optional parameters use the \`{-$paramName}\` syntax and offer fine-grained control over URL structure.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.153.2",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"isbot": "^5.1.22",
|
|
82
82
|
"tiny-invariant": "^1.3.3",
|
|
83
83
|
"tiny-warning": "^1.0.3",
|
|
84
|
-
"@tanstack/
|
|
85
|
-
"@tanstack/
|
|
84
|
+
"@tanstack/router-core": "1.153.2",
|
|
85
|
+
"@tanstack/history": "1.153.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@testing-library/jest-dom": "^6.6.3",
|
package/src/Transitioner.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import { useLayoutEffect, usePrevious } from './utils'
|
|
8
8
|
import { useRouter } from './useRouter'
|
|
9
9
|
import { useRouterState } from './useRouterState'
|
|
10
|
+
import type { SubscriberArgs } from '@tanstack/history'
|
|
10
11
|
|
|
11
12
|
export function Transitioner() {
|
|
12
13
|
const router = useRouter()
|
|
@@ -41,7 +42,17 @@ export function Transitioner() {
|
|
|
41
42
|
// Subscribe to location changes
|
|
42
43
|
// and try to load the new location
|
|
43
44
|
React.useEffect(() => {
|
|
44
|
-
const unsub = router.history.subscribe(
|
|
45
|
+
const unsub = router.history.subscribe(
|
|
46
|
+
({ navigateOpts }: SubscriberArgs) => {
|
|
47
|
+
// If commitLocation initiated this navigation, it handles load() itself
|
|
48
|
+
if (navigateOpts?.skipTransitionerLoad) {
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// External navigation (pop, direct history.push, etc): call load normally
|
|
53
|
+
router.load()
|
|
54
|
+
},
|
|
55
|
+
)
|
|
45
56
|
|
|
46
57
|
const nextLocation = router.buildLocation({
|
|
47
58
|
to: router.latestLocation.pathname,
|