@tanstack/react-router 0.0.1-beta.37 → 0.0.1-beta.38

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.
@@ -7,7 +7,7 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "b631-73",
10
+ "uid": "f894-73",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
@@ -15,15 +15,15 @@
15
15
  "children": [
16
16
  {
17
17
  "name": "@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
18
- "uid": "b631-75"
18
+ "uid": "f894-75"
19
19
  },
20
20
  {
21
21
  "name": "history@5.3.0/node_modules/history/index.js",
22
- "uid": "b631-77"
22
+ "uid": "f894-77"
23
23
  },
24
24
  {
25
25
  "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
26
- "uid": "b631-79"
26
+ "uid": "f894-79"
27
27
  }
28
28
  ]
29
29
  },
@@ -32,11 +32,11 @@
32
32
  "children": [
33
33
  {
34
34
  "name": "router-core/build/esm/index.js",
35
- "uid": "b631-81"
35
+ "uid": "f894-81"
36
36
  },
37
37
  {
38
38
  "name": "react-router/src/index.tsx",
39
- "uid": "b631-83"
39
+ "uid": "f894-83"
40
40
  }
41
41
  ]
42
42
  }
@@ -46,155 +46,155 @@
46
46
  "isRoot": true
47
47
  },
48
48
  "nodeParts": {
49
- "b631-73": {
49
+ "f894-73": {
50
50
  "renderedLength": 793,
51
51
  "gzipLength": 363,
52
52
  "brotliLength": 0,
53
- "mainUid": "b631-72"
53
+ "mainUid": "f894-72"
54
54
  },
55
- "b631-75": {
55
+ "f894-75": {
56
56
  "renderedLength": 435,
57
57
  "gzipLength": 241,
58
58
  "brotliLength": 0,
59
- "mainUid": "b631-74"
59
+ "mainUid": "f894-74"
60
60
  },
61
- "b631-77": {
61
+ "f894-77": {
62
62
  "renderedLength": 20630,
63
63
  "gzipLength": 3800,
64
64
  "brotliLength": 0,
65
- "mainUid": "b631-76"
65
+ "mainUid": "f894-76"
66
66
  },
67
- "b631-79": {
67
+ "f894-79": {
68
68
  "renderedLength": 181,
69
69
  "gzipLength": 129,
70
70
  "brotliLength": 0,
71
- "mainUid": "b631-78"
71
+ "mainUid": "f894-78"
72
72
  },
73
- "b631-81": {
73
+ "f894-81": {
74
74
  "renderedLength": 55587,
75
75
  "gzipLength": 12436,
76
76
  "brotliLength": 0,
77
- "mainUid": "b631-80"
77
+ "mainUid": "f894-80"
78
78
  },
79
- "b631-83": {
80
- "renderedLength": 14157,
81
- "gzipLength": 3525,
79
+ "f894-83": {
80
+ "renderedLength": 14286,
81
+ "gzipLength": 3556,
82
82
  "brotliLength": 0,
83
- "mainUid": "b631-82"
83
+ "mainUid": "f894-82"
84
84
  }
85
85
  },
86
86
  "nodeMetas": {
87
- "b631-72": {
87
+ "f894-72": {
88
88
  "id": "\u0000rollupPluginBabelHelpers.js",
89
89
  "moduleParts": {
90
- "index.production.js": "b631-73"
90
+ "index.production.js": "f894-73"
91
91
  },
92
92
  "imported": [],
93
93
  "importedBy": [
94
94
  {
95
- "uid": "b631-82"
95
+ "uid": "f894-82"
96
96
  }
97
97
  ]
98
98
  },
99
- "b631-74": {
99
+ "f894-74": {
100
100
  "id": "/node_modules/.pnpm/@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
101
101
  "moduleParts": {
102
- "index.production.js": "b631-75"
102
+ "index.production.js": "f894-75"
103
103
  },
104
104
  "imported": [],
105
105
  "importedBy": [
106
106
  {
107
- "uid": "b631-76"
107
+ "uid": "f894-76"
108
108
  }
109
109
  ]
110
110
  },
111
- "b631-76": {
111
+ "f894-76": {
112
112
  "id": "/node_modules/.pnpm/history@5.3.0/node_modules/history/index.js",
113
113
  "moduleParts": {
114
- "index.production.js": "b631-77"
114
+ "index.production.js": "f894-77"
115
115
  },
116
116
  "imported": [
117
117
  {
118
- "uid": "b631-74"
118
+ "uid": "f894-74"
119
119
  }
120
120
  ],
121
121
  "importedBy": [
122
122
  {
123
- "uid": "b631-80"
123
+ "uid": "f894-80"
124
124
  }
125
125
  ]
126
126
  },
127
- "b631-78": {
127
+ "f894-78": {
128
128
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
129
129
  "moduleParts": {
130
- "index.production.js": "b631-79"
130
+ "index.production.js": "f894-79"
131
131
  },
132
132
  "imported": [],
133
133
  "importedBy": [
134
134
  {
135
- "uid": "b631-80"
135
+ "uid": "f894-80"
136
136
  }
137
137
  ]
138
138
  },
139
- "b631-80": {
139
+ "f894-80": {
140
140
  "id": "/packages/router-core/build/esm/index.js",
141
141
  "moduleParts": {
142
- "index.production.js": "b631-81"
142
+ "index.production.js": "f894-81"
143
143
  },
144
144
  "imported": [
145
145
  {
146
- "uid": "b631-76"
146
+ "uid": "f894-76"
147
147
  },
148
148
  {
149
- "uid": "b631-78"
149
+ "uid": "f894-78"
150
150
  }
151
151
  ],
152
152
  "importedBy": [
153
153
  {
154
- "uid": "b631-82"
154
+ "uid": "f894-82"
155
155
  }
156
156
  ]
157
157
  },
158
- "b631-82": {
158
+ "f894-82": {
159
159
  "id": "/packages/react-router/src/index.tsx",
160
160
  "moduleParts": {
161
- "index.production.js": "b631-83"
161
+ "index.production.js": "f894-83"
162
162
  },
163
163
  "imported": [
164
164
  {
165
- "uid": "b631-72"
165
+ "uid": "f894-72"
166
166
  },
167
167
  {
168
- "uid": "b631-84"
168
+ "uid": "f894-84"
169
169
  },
170
170
  {
171
- "uid": "b631-85"
171
+ "uid": "f894-85"
172
172
  },
173
173
  {
174
- "uid": "b631-80"
174
+ "uid": "f894-80"
175
175
  }
176
176
  ],
177
177
  "importedBy": [],
178
178
  "isEntry": true
179
179
  },
180
- "b631-84": {
180
+ "f894-84": {
181
181
  "id": "react",
182
182
  "moduleParts": {},
183
183
  "imported": [],
184
184
  "importedBy": [
185
185
  {
186
- "uid": "b631-82"
186
+ "uid": "f894-82"
187
187
  }
188
188
  ],
189
189
  "isExternal": true
190
190
  },
191
- "b631-85": {
191
+ "f894-85": {
192
192
  "id": "use-sync-external-store/shim",
193
193
  "moduleParts": {},
194
194
  "imported": [],
195
195
  "importedBy": [
196
196
  {
197
- "uid": "b631-82"
197
+ "uid": "f894-82"
198
198
  }
199
199
  ],
200
200
  "isExternal": true
@@ -91,7 +91,8 @@ declare function useMatch<TId extends keyof RegisteredAllRouteInfo['routeInfoByI
91
91
  }): TStrict extends true ? RouteMatch<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> : RouteMatch<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> | undefined;
92
92
  declare function useNearestMatch(): RouteMatch<RegisteredAllRouteInfo, RouteInfo>;
93
93
  declare function useRoute<TId extends keyof RegisteredAllRouteInfo['routeInfoById']>(routeId: TId): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]>;
94
- declare function useSearch<TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = keyof RegisteredAllRouteInfo['routeInfoById']>(_routeId?: TId): RegisteredAllRouteInfo['fullSearchSchema'];
94
+ declare function useSearch(): RegisteredAllRouteInfo['fullSearchSchema'];
95
+ declare function useParams(): RegisteredAllRouteInfo['allParams'];
95
96
  declare function linkProps<TTo extends string = '.'>(props: MakeLinkPropsOptions<RegisteredAllRouteInfo, '/', TTo>): React.AnchorHTMLAttributes<HTMLAnchorElement>;
96
97
  declare function MatchRoute<TTo extends string = '.'>(props: MakeMatchRouteOptions<RegisteredAllRouteInfo, '/', TTo>): JSX.Element;
97
98
  declare function Outlet(): JSX.Element | null;
@@ -101,4 +102,4 @@ declare function DefaultErrorBoundary({ error }: {
101
102
  declare function usePrompt(message: string, when: boolean | any): void;
102
103
  declare function Prompt({ message, when, children }: PromptProps): React.ReactNode;
103
104
 
104
- export { DefaultErrorBoundary, Link, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MatchRoute, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, createReactRouter, lazy, linkProps, matchesContext, routerContext, useMatch, useMatches, useNearestMatch, usePrompt, useRoute, useRouter, useSearch };
105
+ export { DefaultErrorBoundary, Link, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MatchRoute, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, createReactRouter, lazy, linkProps, matchesContext, routerContext, useMatch, useMatches, useNearestMatch, useParams, usePrompt, useRoute, useRouter, useSearch };
@@ -2645,9 +2645,13 @@
2645
2645
  const router = useRouter();
2646
2646
  return router.useRoute(routeId);
2647
2647
  }
2648
- function useSearch(_routeId) {
2648
+ function useSearch() {
2649
2649
  return useRouter().state.currentLocation.search;
2650
2650
  }
2651
+ function useParams() {
2652
+ var _last;
2653
+ return (_last = last(useRouter().state.currentMatches)) == null ? void 0 : _last.params;
2654
+ }
2651
2655
  function linkProps(props) {
2652
2656
  const router = useRouter();
2653
2657
  return router.linkProps(props);
@@ -2837,6 +2841,7 @@
2837
2841
  exports.useMatch = useMatch;
2838
2842
  exports.useMatches = useMatches;
2839
2843
  exports.useNearestMatch = useNearestMatch;
2844
+ exports.useParams = useParams;
2840
2845
  exports.usePrompt = usePrompt;
2841
2846
  exports.useRoute = useRoute;
2842
2847
  exports.useRouter = useRouter;