Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update router.md to improve a11y #23611

Merged
merged 1 commit into from Apr 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/api-reference/next/router.md
Expand Up @@ -99,7 +99,7 @@ import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()

return <span onClick={() => router.push('/post/abc')}>Click me</span>
return <button onClick={() => router.push('/post/abc')}>Click me</button>
}
```

Expand Down Expand Up @@ -137,7 +137,7 @@ export default function ReadMore({ post }) {
const router = useRouter()

return (
<span
<button
onClick={() => {
router.push({
pathname: '/post/[pid]',
Expand All @@ -146,7 +146,7 @@ export default function ReadMore({ post }) {
}}
>
Click here to read more
</span>
</button>
)
}
```
Expand All @@ -171,7 +171,7 @@ import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()

return <span onClick={() => router.replace('/home')}>Click me</span>
return <button onClick={() => router.replace('/home')}>Click me</button>
}
```

Expand Down Expand Up @@ -282,7 +282,7 @@ import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()

return <span onClick={() => router.back()}>Click here to go back</span>
return <button onClick={() => router.back()}>Click here to go back</button>
}
```

Expand All @@ -298,7 +298,7 @@ import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()

return <span onClick={() => router.reload()}>Click here to reload</span>
return <button onClick={() => router.reload()}>Click here to reload</button>
}
```

Expand Down