rsnext/test/integration/scroll-forward-restoration/pages/index.js

51 lines
767 B
JavaScript
Raw Normal View History

import Link from 'next/link'
const Page = ({ loaded }) => {
const link = (
<Link href="/another">
<a
id="to-another"
style={{
marginLeft: 5000,
width: 95000,
display: 'block',
}}
>
to another
</a>
</Link>
)
if (typeof window !== 'undefined') {
window.didHydrate = true
}
if (loaded) {
return (
<>
<div
style={{
width: 10000,
height: 10000,
background: 'orange',
}}
/>
{link}
<div id="end-el">the end</div>
</>
)
}
return link
}
export default Page
export const getServerSideProps = () => {
return {
props: {
loaded: true,
},
}
}