2019-02-28 19:53:29 +01:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { withRouter } from 'next/router'
|
|
|
|
|
|
|
|
export default withRouter(({ router: { asPath, query } }) => {
|
2019-05-30 03:19:32 +02:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
id={asPath
|
|
|
|
.replace('/', '')
|
|
|
|
.replace('/', '-')
|
|
|
|
.replace('?', '-')
|
|
|
|
.replace('=', '-')}
|
|
|
|
>
|
2019-11-11 04:24:53 +01:00
|
|
|
<div id="router-query">{JSON.stringify(query)}</div>
|
2019-05-30 03:19:32 +02:00
|
|
|
<div>
|
|
|
|
<Link
|
2019-11-11 04:24:53 +01:00
|
|
|
href="/nav/as-path-query?something=hello"
|
|
|
|
as="/something/hello?something=hello"
|
2019-05-30 03:19:32 +02:00
|
|
|
>
|
2019-11-11 04:24:53 +01:00
|
|
|
<a id="hello">hello</a>
|
2019-05-30 03:19:32 +02:00
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<Link
|
2019-11-11 04:24:53 +01:00
|
|
|
href="/nav/as-path-query?something=else"
|
|
|
|
as="/something/hello?something=else"
|
2019-05-30 03:19:32 +02:00
|
|
|
>
|
2019-11-11 04:24:53 +01:00
|
|
|
<a id="hello2">hello</a>
|
2019-05-30 03:19:32 +02:00
|
|
|
</Link>
|
|
|
|
</div>
|
2019-02-28 19:53:29 +01:00
|
|
|
</div>
|
2019-05-30 03:19:32 +02:00
|
|
|
)
|
2019-02-28 19:53:29 +01:00
|
|
|
})
|