@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/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.activeMatchesSnapshot.get()
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.activeMatchesSnapshot,
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
  }
@@ -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 hasPendingMatches = useStore(
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 || hasPendingMatches
24
+ const isAnyPending = isLoading || isTransitioning || hasPending
28
25
  const previousIsAnyPending = usePrevious(isAnyPending)
29
26
 
30
- const isPagePending = isLoading || hasPendingMatches
27
+ const isPagePending = isLoading || hasPending
31
28
  const previousIsPagePending = usePrevious(isPagePending)
32
29
 
33
30
  router.startTransition = (fn: () => void) => {
@@ -194,14 +194,14 @@ export const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {
194
194
  return buildTagsFromMatches(
195
195
  router,
196
196
  nonce,
197
- router.stores.activeMatchesSnapshot.get(),
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.activeMatchesSnapshot,
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.activeMatchesSnapshot,
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.activeMatchesSnapshot,
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.activeMatchesSnapshot,
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.activeMatchesSnapshot,
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.getMatchStoreByRouteId(key)
117
- : router.stores.activeMatchStoresById.get(key)
116
+ ? router.stores.getRouteMatchStore(key)
117
+ : router.stores.matchStores.get(key)
118
118
  : undefined
119
119
 
120
120
  if (isServer ?? router.isServer) {