File size: 1,018 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import Link from 'next/link'
import { withRouter } from 'next/router'

export default withRouter(({ router: { asPath, query } }) => {
  return (
    <div id={asPath.replace('/', '').replace('/', '-')}>
      <div id="router-query">{JSON.stringify(query)}</div>
      <div>
        <Link
          href="/nav/as-path-pushstate?something=hello"
          as="/something/hello"
          id="hello"
        >
          hello
        </Link>
      </div>
      <div>
        <Link href="/nav/as-path-pushstate" as="/something/else" id="else">
          else
        </Link>
      </div>
      <div>
        <Link
          href="/nav/as-path-pushstate"
          as="/nav/as-path-pushstate"
          id="hello2"
        >
          normal hello
        </Link>
      </div>
      {query.something === 'hello' && (
        <Link
          href="/nav/as-path-pushstate?something=hello"
          as="/something/same-query"
          id="same-query"
        >
          same query
        </Link>
      )}
    </div>
  )
})