Skip to content

Commit

Permalink
Clarify valid catch all routes
Browse files Browse the repository at this point in the history
  • Loading branch information
lfades committed Jan 30, 2020
1 parent 438fc72 commit 48086c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api-reference/next/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function NavLink({ href, name }) {
export default NavLink
```

> **Note:** If you’re using [emotion](https://emotion.sh/)’s JSX pragma feature (`@jsx jsx`), you must use `passHref` even if you use an `<a>` tag directly.
> **Note**: If you’re using [emotion](https://emotion.sh/)’s JSX pragma feature (`@jsx jsx`), you must use `passHref` even if you use an `<a>` tag directly.
## If the child is a function component

Expand Down
2 changes: 2 additions & 0 deletions docs/api-routes/dynamic-api-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ API Routes can be extended to catch all paths by adding three dots (`...`) insid

- `pages/api/post/[...slug].js` matches `/api/post/a`, but also `/api/post/a/b`, `/api/post/a/b/c` and so on.

> **Note**: `slug` is only a name, it can be anything, a catch all API route is formed by having the brackets used by dynamic API routes, the three dots and the name (`[...param]`).
Matched parameters will be sent as a query parameter (`slug` in the example) to the page, and it will always be an array, so, the path `/api/post/a` will have the following `query` object:

```json
Expand Down
2 changes: 2 additions & 0 deletions docs/routing/dynamic-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Dynamic routes can be extended to catch all paths by adding three dots (`...`) i

- `pages/post/[...slug].js` matches `/post/a`, but also `/post/a/b`, `/post/a/b/c` and so on.

> **Note**: `slug` is only a name, it can be anything, a catch all route is formed by having the brackets used by dynamic routes, and the three dots, and the page name (`[...param]`).
Matched parameters will be sent as a query parameter (`slug` in the example) to the page, and it will always be an array, so, the path `/post/a` will have the following `query` object:

```json
Expand Down

0 comments on commit 48086c2

Please sign in to comment.