mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
fix prefetching relative path (#1151)
This commit is contained in:
parent
db97fbffad
commit
38d236e2b3
|
@ -82,7 +82,9 @@ export default class Link extends Component {
|
|||
// Prefetch the JSON page if asked (only in the client)
|
||||
if (prefetch) {
|
||||
if (typeof window !== 'undefined') {
|
||||
Router.prefetch(props.href)
|
||||
const { pathname } = window.location
|
||||
const href = resolve(pathname, props.href)
|
||||
Router.prefetch(href)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue