Skip to content

Commit

Permalink
Update routing.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
klequis authored and atilafassina committed Jun 18, 2024
1 parent 6bc55f0 commit b2d7212
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/solid-start/building-your-application/routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ They are defined using square brackets with `...` before the label for the route
|-- [...post].tsx
```

The value of the catch-all route will be an array of strings, where each string is a segment of the URL path that matched the catch-all route.
For example, with the route `[...post]`, the value of `post` will be a property on the `params` object that is returned by the `useParams` hook.
It will be a string with the value of the dynamic segment.
A catch-all route will have one parameter which is a forward-slash delimited string of all the URL segments after the last valid segment.
For example, with the route `[..post]` and a URL path of `/post/foo` the `params` object returned from the `useParams` primitive will have a `post` property with the value of `foo`.
For a URL path of `/post/foo/baz` it will be `foo/baz`.

```tsx title="routes/blog/[...post].tsx"
import { useParams } from "@solidjs/router";
Expand Down

0 comments on commit b2d7212

Please sign in to comment.