@tanstack/react-router 0.0.1-beta.264 → 0.0.1-beta.266

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.264",
4
+ "version": "0.0.1-beta.266",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -44,7 +44,7 @@
44
44
  "@tanstack/store": "^0.1.3",
45
45
  "tiny-invariant": "^1.3.1",
46
46
  "tiny-warning": "^1.0.3",
47
- "@tanstack/history": "0.0.1-beta.264"
47
+ "@tanstack/history": "0.0.1-beta.266"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js"
package/src/Matches.tsx CHANGED
@@ -37,6 +37,7 @@ export interface RouteMatch<
37
37
  loadPromise?: Promise<void>
38
38
  loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData']
39
39
  __resolveLoadPromise?: () => void
40
+ routeContext: RouteById<TRouteTree, TRouteId>['types']['routeContext']
40
41
  context: RouteById<TRouteTree, TRouteId>['types']['allContext']
41
42
  search: FullSearchSchema<TRouteTree> &
42
43
  RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema']
@@ -179,7 +179,6 @@ function Transitioner() {
179
179
  })
180
180
 
181
181
  if ((document as any).querySelector) {
182
- console.log('hello', routerState.location.hash)
183
182
  const el = document.getElementById(
184
183
  routerState.location.hash,
185
184
  ) as HTMLElement | null
package/src/router.ts CHANGED
@@ -667,6 +667,7 @@ export class Router<
667
667
  error: undefined,
668
668
  paramsError: parseErrors[index],
669
669
  loadPromise: Promise.resolve(),
670
+ routeContext: undefined!,
670
671
  context: undefined!,
671
672
  abortController: new AbortController(),
672
673
  shouldReloadDeps: undefined,
@@ -997,8 +998,6 @@ export class Router<
997
998
  }))
998
999
  }
999
1000
 
1000
-
1001
-
1002
1001
  // Check each match middleware to see if the route can be accessed
1003
1002
  try {
1004
1003
  for (let [index, match] of matches.entries()) {
@@ -1071,6 +1070,10 @@ export class Router<
1071
1070
 
1072
1071
  matches[index] = match = {
1073
1072
  ...match,
1073
+ routeContext: replaceEqualDeep(
1074
+ match.routeContext,
1075
+ beforeLoadContext,
1076
+ ),
1074
1077
  context: replaceEqualDeep(match.context, context),
1075
1078
  abortController,
1076
1079
  }