@tanstack/react-router 0.0.1-beta.222 → 0.0.1-beta.224

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.222",
4
+ "version": "0.0.1-beta.224",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -42,7 +42,7 @@
42
42
  "@babel/runtime": "^7.16.7",
43
43
  "tiny-invariant": "^1.3.1",
44
44
  "tiny-warning": "^1.0.3",
45
- "@tanstack/history": "0.0.1-beta.222"
45
+ "@tanstack/history": "0.0.1-beta.224"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "rollup --config rollup.config.js"
package/src/Matches.tsx CHANGED
@@ -2,14 +2,50 @@ import * as React from 'react'
2
2
  import invariant from 'tiny-invariant'
3
3
  import warning from 'tiny-warning'
4
4
  import { CatchBoundary, ErrorComponent } from './CatchBoundary'
5
- import { RouteMatch } from './RouterProvider'
6
5
  import { useRouter, useRouterState } from './RouterProvider'
7
6
  import { ResolveRelativePath, ToOptions } from './link'
8
7
  import { AnyRoute, ReactNode, rootRouteId } from './route'
9
- import { RouteById, RouteByPath, RouteIds, RoutePaths } from './routeInfo'
8
+ import {
9
+ FullSearchSchema,
10
+ ParseRoute,
11
+ RouteById,
12
+ RouteByPath,
13
+ RouteIds,
14
+ RoutePaths,
15
+ } from './routeInfo'
10
16
  import { RegisteredRouter } from './router'
11
17
  import { NoInfer, StrictOrFrom } from './utils'
12
18
 
19
+ export interface RouteMatch<
20
+ TRouteTree extends AnyRoute = AnyRoute,
21
+ TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id'],
22
+ > {
23
+ id: string
24
+ routeId: TRouteId
25
+ pathname: string
26
+ params: RouteById<TRouteTree, TRouteId>['types']['allParams']
27
+ status: 'pending' | 'success' | 'error'
28
+ isFetching: boolean
29
+ invalid: boolean
30
+ error: unknown
31
+ paramsError: unknown
32
+ searchError: unknown
33
+ updatedAt: number
34
+ loadPromise?: Promise<void>
35
+ loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData']
36
+ __resolveLoadPromise?: () => void
37
+ context: RouteById<TRouteTree, TRouteId>['types']['allContext']
38
+ routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema']
39
+ search: FullSearchSchema<TRouteTree> &
40
+ RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema']
41
+ fetchedAt: number
42
+ shouldReloadDeps: any
43
+ abortController: AbortController
44
+ cause: 'enter' | 'stay'
45
+ }
46
+
47
+ export type AnyRouteMatch = RouteMatch<any>
48
+
13
49
  export function Matches() {
14
50
  const { routesById, state } = useRouter()
15
51
  const { matches } = state