Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
7f998950
Unverified
Commit
7f998950
authored
Sep 27, 2021
by
Lee Robinson
Committed by
GitHub
Sep 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update imperative routing docs to have better a11y (#29382)
We should recommend using a `button` instead of a `span`
👍
parent
2271cd84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
imperatively.md
docs/routing/imperatively.md
+4
-4
No files found.
docs/routing/imperatively.md
View file @
7f998950
...
@@ -18,13 +18,13 @@ The following example shows how to do basic page navigations with [`useRouter`](
...
@@ -18,13 +18,13 @@ The following example shows how to do basic page navigations with [`useRouter`](
```
jsx
```
jsx
import
{
useRouter
}
from
'next/router'
import
{
useRouter
}
from
'next/router'
function
ReadMore
()
{
export
default
function
ReadMore
()
{
const
router
=
useRouter
()
const
router
=
useRouter
()
return
(
return
(
<
span
onClick=
{
()
=>
router
.
push
(
'/about'
)
}
>
Click here to read more
</
span
>
<
button
onClick=
{
()
=>
router
.
push
(
'/about'
)
}
>
Click here to read more
</
button
>
)
)
}
}
export
default
ReadMore
```
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment