File size: 404 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export const Link = (props: {
  href: string
  children: any
  class?: string
}) => {
  // Links doing client-side navigation
  return (
    <a
      href={props.href}
      onClick={(e) => {
        e.preventDefault()
        history.pushState({}, '', props.href)
        window.dispatchEvent(new PopStateEvent('popstate'))
      }}
      class={props.class}
    >
      {props.children}
    </a>
  )
}