@tanstack/react-router 1.19.11 → 1.19.13

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/router.ts CHANGED
@@ -1953,15 +1953,23 @@ export class Router<
1953
1953
  if (dehydratedMatch) {
1954
1954
  const route = this.looseRoutesById[match.routeId]!
1955
1955
 
1956
+ const assets =
1957
+ dehydratedMatch.status === 'notFound' ||
1958
+ dehydratedMatch.status === 'redirected'
1959
+ ? {}
1960
+ : {
1961
+ meta: route.options.meta?.({
1962
+ params: match.params,
1963
+ loaderData: dehydratedMatch.loaderData,
1964
+ }),
1965
+ links: route.options.links?.(),
1966
+ scripts: route.options.scripts?.(),
1967
+ }
1968
+
1956
1969
  return {
1957
1970
  ...match,
1958
1971
  ...dehydratedMatch,
1959
- meta: route.options.meta?.({
1960
- params: match.params,
1961
- loaderData: dehydratedMatch.loaderData,
1962
- }),
1963
- links: route.options.links?.(),
1964
- scripts: route.options.scripts?.(),
1972
+ ...assets,
1965
1973
  }
1966
1974
  }
1967
1975
  return match