@tanstack/router-core 0.0.1-beta.165 → 0.0.1-beta.166

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/router-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.165",
4
+ "version": "0.0.1-beta.166",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -43,7 +43,7 @@
43
43
  "tiny-invariant": "^1.3.1",
44
44
  "tiny-warning": "^1.0.3",
45
45
  "@gisatcz/cross-package-react-context": "^0.2.0",
46
- "@tanstack/react-store": "0.0.1-beta.165"
46
+ "@tanstack/react-store": "0.0.1-beta.166"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "rollup --config rollup.config.js",
package/src/route.ts CHANGED
@@ -126,6 +126,30 @@ export type RouteProps<
126
126
  }) => TSelected
127
127
  }
128
128
 
129
+ export type PendingRouteProps<
130
+ TFullSearchSchema extends AnySearchSchema = AnySearchSchema,
131
+ TAllParams extends AnyPathParams = AnyPathParams,
132
+ TRouteContext extends AnyContext = AnyContext,
133
+ TContext extends AnyContext = AnyContext,
134
+ > = Omit<
135
+ RouteProps<any, TFullSearchSchema, TAllParams, TRouteContext, TContext>,
136
+ 'useLoader'
137
+ >
138
+
139
+ export type ErrorRouteProps<
140
+ TFullSearchSchema extends AnySearchSchema = AnySearchSchema,
141
+ TAllParams extends AnyPathParams = AnyPathParams,
142
+ TRouteContext extends AnyContext = AnyContext,
143
+ TContext extends AnyContext = AnyContext,
144
+ > = PendingRouteProps<
145
+ TFullSearchSchema,
146
+ TAllParams,
147
+ TRouteContext,
148
+ TContext
149
+ > & {
150
+ error: unknown
151
+ }
152
+
129
153
  export type RouteOptions<
130
154
  TParentRoute extends AnyRoute = AnyRoute,
131
155
  TCustomId extends string = string,
@@ -284,19 +308,11 @@ export type UpdatableRouteOptions<
284
308
  >
285
309
  // The content to be rendered when the route encounters an error
286
310
  errorComponent?: RegisteredRouteErrorComponent<
287
- { error: unknown } & Partial<
288
- RouteProps<
289
- TLoader,
290
- TFullSearchSchema,
291
- TAllParams,
292
- TRouteContext,
293
- TContext
294
- >
295
- >
311
+ ErrorRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>
296
312
  > //
297
313
  // If supported by your framework, the content to be rendered as the fallback content until the route is ready to render
298
314
  pendingComponent?: RegisteredRouteComponent<
299
- RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>
315
+ PendingRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>
300
316
  >
301
317
  // Filter functions that can manipulate search params *before* they are passed to links and navigate
302
318
  // calls that match this route.
package/src/router.ts CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  RouteProps,
30
30
  RegisteredRouteComponent,
31
31
  RegisteredRouteErrorComponent,
32
+ ErrorRouteProps,
32
33
  } from './route'
33
34
  import {
34
35
  RoutesById,
@@ -159,7 +160,7 @@ export interface RouterOptions<
159
160
  RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>
160
161
  >
161
162
  defaultErrorComponent?: RegisteredRouteErrorComponent<
162
- RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>
163
+ ErrorRouteProps<AnySearchSchema, AnyPathParams, AnyContext, AnyContext>
163
164
  >
164
165
  defaultPendingComponent?: RegisteredRouteComponent<
165
166
  RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>