Skip to content

Commit e87513b

Browse files
committed
#187 asPath for Link
1 parent c11f757 commit e87513b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

book/8-end/components/Header.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,14 @@ function Header({ user, hideHeader, redirectUrl }) {
8989
) : (
9090
<Link
9191
prefetch
92-
href={{ pathname: '/public/login', asPath: '/login', query: { redirectUrl } }}
92+
href={{
93+
pathname: '/public/login',
94+
query: { redirectUrl },
95+
}}
96+
as={{
97+
pathname: '/login',
98+
query: { redirectUrl },
99+
}}
93100
>
94101
<a style={{ margin: '0px 20px 0px auto' }}>Log in</a>
95102
</Link>

components/Header.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ function Header({ user, hideHeader, next }) {
9898
</Link>
9999
<Link
100100
prefetch
101-
href={{ pathname: '/public/login', asPath: '/login', query: { next } }}
101+
href={{
102+
pathname: '/public/login',
103+
query: { next },
104+
}}
105+
as={{
106+
pathname: '/login',
107+
query: { next },
108+
}}
102109
>
103110
<a style={{ margin: '0px 20px 0px auto' }}>Log in</a>
104111
</Link>

0 commit comments

Comments
 (0)