@tanstack/react-router 1.168.14 → 1.168.15
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/Match.cjs +6 -6
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/Matches.cjs +4 -4
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Scripts.cjs +3 -3
- package/dist/cjs/Scripts.cjs.map +1 -1
- package/dist/cjs/Transitioner.cjs +3 -3
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/headContentUtils.cjs +6 -6
- package/dist/cjs/headContentUtils.cjs.map +1 -1
- package/dist/cjs/useMatch.cjs +1 -1
- package/dist/cjs/useMatch.cjs.map +1 -1
- package/dist/esm/Match.js +6 -6
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.js +4 -4
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/Scripts.js +3 -3
- package/dist/esm/Scripts.js.map +1 -1
- package/dist/esm/Transitioner.js +3 -3
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/headContentUtils.js +6 -6
- package/dist/esm/headContentUtils.js.map +1 -1
- package/dist/esm/useMatch.js +1 -1
- package/dist/esm/useMatch.js.map +1 -1
- package/package.json +2 -2
- package/src/Match.tsx +6 -6
- package/src/Matches.tsx +5 -5
- package/src/Scripts.tsx +3 -7
- package/src/Transitioner.tsx +3 -6
- package/src/headContentUtils.tsx +6 -6
- package/src/useMatch.tsx +2 -2
package/src/Scripts.tsx
CHANGED
|
@@ -58,7 +58,7 @@ export const Scripts = () => {
|
|
|
58
58
|
)
|
|
59
59
|
|
|
60
60
|
if (isServer ?? router.isServer) {
|
|
61
|
-
const activeMatches = router.stores.
|
|
61
|
+
const activeMatches = router.stores.matches.get()
|
|
62
62
|
const assetScripts = getAssetScripts(activeMatches)
|
|
63
63
|
const scripts = getScripts(activeMatches)
|
|
64
64
|
return renderScripts(router, scripts, assetScripts)
|
|
@@ -66,16 +66,12 @@ export const Scripts = () => {
|
|
|
66
66
|
|
|
67
67
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
68
68
|
const assetScripts = useStore(
|
|
69
|
-
router.stores.
|
|
69
|
+
router.stores.matches,
|
|
70
70
|
getAssetScripts,
|
|
71
71
|
deepEqual,
|
|
72
72
|
)
|
|
73
73
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
74
|
-
const scripts = useStore(
|
|
75
|
-
router.stores.activeMatchesSnapshot,
|
|
76
|
-
getScripts,
|
|
77
|
-
deepEqual,
|
|
78
|
-
)
|
|
74
|
+
const scripts = useStore(router.stores.matches, getScripts, deepEqual)
|
|
79
75
|
|
|
80
76
|
return renderScripts(router, scripts, assetScripts)
|
|
81
77
|
}
|
package/src/Transitioner.tsx
CHANGED
|
@@ -17,17 +17,14 @@ export function Transitioner() {
|
|
|
17
17
|
const [isTransitioning, setIsTransitioning] = React.useState(false)
|
|
18
18
|
// Track pending state changes
|
|
19
19
|
const isLoading = useStore(router.stores.isLoading, (value) => value)
|
|
20
|
-
const
|
|
21
|
-
router.stores.hasPendingMatches,
|
|
22
|
-
(value) => value,
|
|
23
|
-
)
|
|
20
|
+
const hasPending = useStore(router.stores.hasPending, (value) => value)
|
|
24
21
|
|
|
25
22
|
const previousIsLoading = usePrevious(isLoading)
|
|
26
23
|
|
|
27
|
-
const isAnyPending = isLoading || isTransitioning ||
|
|
24
|
+
const isAnyPending = isLoading || isTransitioning || hasPending
|
|
28
25
|
const previousIsAnyPending = usePrevious(isAnyPending)
|
|
29
26
|
|
|
30
|
-
const isPagePending = isLoading ||
|
|
27
|
+
const isPagePending = isLoading || hasPending
|
|
31
28
|
const previousIsPagePending = usePrevious(isPagePending)
|
|
32
29
|
|
|
33
30
|
router.startTransition = (fn: () => void) => {
|
package/src/headContentUtils.tsx
CHANGED
|
@@ -194,14 +194,14 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
|
|
|
194
194
|
return buildTagsFromMatches(
|
|
195
195
|
router,
|
|
196
196
|
nonce,
|
|
197
|
-
router.stores.
|
|
197
|
+
router.stores.matches.get(),
|
|
198
198
|
assetCrossOrigin,
|
|
199
199
|
)
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
203
203
|
const routeMeta = useStore(
|
|
204
|
-
router.stores.
|
|
204
|
+
router.stores.matches,
|
|
205
205
|
(matches) => {
|
|
206
206
|
return matches.map((match) => match.meta!).filter(Boolean)
|
|
207
207
|
},
|
|
@@ -282,7 +282,7 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
|
|
|
282
282
|
|
|
283
283
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
284
284
|
const links = useStore(
|
|
285
|
-
router.stores.
|
|
285
|
+
router.stores.matches,
|
|
286
286
|
(matches) => {
|
|
287
287
|
const constructed = matches
|
|
288
288
|
.map((match) => match.links!)
|
|
@@ -327,7 +327,7 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
|
|
|
327
327
|
|
|
328
328
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
329
329
|
const preloadLinks = useStore(
|
|
330
|
-
router.stores.
|
|
330
|
+
router.stores.matches,
|
|
331
331
|
(matches) => {
|
|
332
332
|
const preloadLinks: Array<RouterManagedTag> = []
|
|
333
333
|
|
|
@@ -359,7 +359,7 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
|
|
|
359
359
|
|
|
360
360
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
361
361
|
const styles = useStore(
|
|
362
|
-
router.stores.
|
|
362
|
+
router.stores.matches,
|
|
363
363
|
(matches) =>
|
|
364
364
|
(
|
|
365
365
|
matches
|
|
@@ -379,7 +379,7 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
|
|
|
379
379
|
|
|
380
380
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
|
|
381
381
|
const headScripts: Array<RouterManagedTag> = useStore(
|
|
382
|
-
router.stores.
|
|
382
|
+
router.stores.matches,
|
|
383
383
|
(matches) =>
|
|
384
384
|
(
|
|
385
385
|
matches
|
package/src/useMatch.tsx
CHANGED
|
@@ -113,8 +113,8 @@ export function useMatch<
|
|
|
113
113
|
const key = opts.from ?? nearestMatchId
|
|
114
114
|
const matchStore = key
|
|
115
115
|
? opts.from
|
|
116
|
-
? router.stores.
|
|
117
|
-
: router.stores.
|
|
116
|
+
? router.stores.getRouteMatchStore(key)
|
|
117
|
+
: router.stores.matchStores.get(key)
|
|
118
118
|
: undefined
|
|
119
119
|
|
|
120
120
|
if (isServer ?? router.isServer) {
|