You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,7 @@ Specific to the `Route` component:
217
217
218
218
Paths are matched using a simple string matching algorithm. The following features may be used:
219
219
220
-
-`:param` - Matches any URL segment, binding the value to the label (can later extract this value from `useRoute()`)
220
+
-`:param` - Matches any URL segment, binding the value to the label (can extract this value as `pathParams`from `useLocation()`)
221
221
-`/profile/:id` will match `/profile/123` and `/profile/abc`
222
222
-`/profile/:id?` will match `/profile` and `/profile/123`
223
223
-`/profile/:id*` will match `/profile`, `/profile/123`, and `/profile/123/abc`
@@ -244,19 +244,10 @@ Returns an object with the following properties:
244
244
245
245
-`url: string` - The current path & search params
246
246
-`path: string` - The current path
247
-
-`query: Record<string, string>` - The current query string parameters (`/profile?name=John` -> `{ name: 'John' }`)
247
+
-`pathParams: Record<string, string>` - The current route parameters (`/profile/:id` -> `{ id: '123' }`)
248
+
-`searchParams: Record<string, string>` - The current query string parameters (`/profile?name=John` -> `{ name: 'John' }`)
248
249
-`route: (url: string, replace?: boolean) => void` - A function to programmatically navigate to a new route. The `replace` param can optionally be used to overwrite history, navigating them away without keeping the current location in the history stack.
249
250
250
-
### `useRoute`
251
-
252
-
A hook to access current route information. Unlike `useLocation`, this hook only works within `<Router>` components.
253
-
254
-
Returns an object with the following properties:
255
-
256
-
-`path: string` - The current path
257
-
-`query: Record<string, string>` - The current query string parameters (`/profile?name=John` -> `{ name: 'John' }`)
258
-
-`params: Record<string, string>` - The current route parameters (`/profile/:id` -> `{ id: '123' }`)
0 commit comments