rsnext/test/integration/dynamic-routing/pages/on-mount/[post].js
Joe Haddad 60b4e678b0
Fix client-side hydration with dynamic routes (#7986)
* Add a test for the hash case

* Add a special hydration option to router

* Add additional tests wrt scrolling
2019-07-15 16:07:04 -07:00

18 lines
384 B
JavaScript

import { useRouter } from 'next/router'
export default () => {
const router = useRouter()
const { query } = router
return (
<>
<p>onmpost: {query.post || 'pending'}</p>
{Array.from({ length: 500 }, (x, i) => i + 1).map(i => {
return (
<div key={`item-${i}`} id={`item-${i}`}>
{i}
</div>
)
})}
</>
)
}