mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Co-authored-by: Omar McIver <[email protected]> Co-authored-by: Jiachi Liu <[email protected]>
19 lines
393 B
JavaScript
19 lines
393 B
JavaScript
import Link from 'next/link'
|
|
import { useRouter } from 'next/router'
|
|
|
|
export function getServerSideProps({ params }) {
|
|
return { props: { slug: params.slug, now: Date.now() } }
|
|
}
|
|
|
|
export default function Page(props) {
|
|
const router = useRouter()
|
|
return (
|
|
<>
|
|
<p id="slug">{props.slug}</p>
|
|
<Link id="now" href={router.asPath}>
|
|
{props.now}
|
|
</Link>
|
|
</>
|
|
)
|
|
}
|