Skip to content

Commit 30009fb

Browse files
Upgrade to Next.js 13 (#5)
* Upgrade to Next.js 13 * simplify changes Co-authored-by: Mike Fix <mfix@stripe.com>
1 parent 65c685c commit 30009fb

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

components/SideNav.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export function SideNav() {
2222
const active = router.pathname === link.href;
2323
return (
2424
<li key={link.href} className={active ? 'active' : ''}>
25-
<Link {...link}>
26-
<a href={link.href}>{link.children}</a>
27-
</Link>
25+
<Link {...link} />
2826
</li>
2927
);
3028
})}
@@ -54,11 +52,11 @@ export function SideNav() {
5452
list-style: none;
5553
margin: 0;
5654
}
57-
li a {
55+
li :global(a) {
5856
text-decoration: none;
5957
}
60-
li a:hover,
61-
li.active > a {
58+
li :global(a:hover),
59+
li.active :global(a) {
6260
text-decoration: underline;
6361
}
6462
`}

components/TableOfContents.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export function TableOfContents({toc}) {
2727
.filter(Boolean)
2828
.join(' ')}
2929
>
30-
<Link href={href} passHref>
31-
<a>{item.title}</a>
30+
<Link href={href}>
31+
{item.title}
3232
</Link>
3333
</li>
3434
);
@@ -54,11 +54,11 @@ export function TableOfContents({toc}) {
5454
list-style-type: none;
5555
margin: 0 0 1rem;
5656
}
57-
li a {
57+
li :global(a) {
5858
text-decoration: none;
5959
}
60-
li a:hover,
61-
li.active a {
60+
li :global(a:hover),
61+
li.active :global(a) {
6262
text-decoration: underline;
6363
}
6464
li.padded {

0 commit comments

Comments
 (0)