2019-05-01 15:14:27 +02:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { useState } from 'react'
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const [href, setHref] = useState('/first')
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2019-11-11 04:24:53 +01:00
|
|
|
<a href="#scroll-to-me" id="scroll-to-another">
|
2019-05-30 03:19:32 +02:00
|
|
|
Scroll to another
|
|
|
|
</a>
|
2019-05-01 15:14:27 +02:00
|
|
|
<button onClick={() => setHref('/another')}>Click me</button>
|
|
|
|
<Link href={href}>
|
|
|
|
<a>to {href}</a>
|
|
|
|
</Link>
|
2019-05-30 03:19:32 +02:00
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
height: 10000,
|
|
|
|
width: 20,
|
2019-11-11 04:24:53 +01:00
|
|
|
background: 'orange',
|
2019-05-30 03:19:32 +02:00
|
|
|
}}
|
|
|
|
/>
|
2019-11-11 04:24:53 +01:00
|
|
|
<p id="scroll-to-me">Hi 👋</p>
|
|
|
|
<Link href="/another">
|
2019-05-01 15:14:27 +02:00
|
|
|
<a>to /another</a>
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|