rsnext/test/integration/prerender/pages/user/[user]/profile.js

31 lines
607 B
JavaScript
Raw Normal View History

import React from 'react'
import Link from 'next/link'
// eslint-disable-next-line camelcase
export async function unstable_getStaticPaths() {
return { paths: [] }
}
// eslint-disable-next-line camelcase
export async function unstable_getStaticProps({ params }) {
return {
props: {
user: params.user,
time: (await import('perf_hooks')).performance.now(),
},
revalidate: 10,
}
}
export default ({ user, time }) => {
return (
<>
<p>User: {user}</p>
<span>time: {time}</span>
<Link href="/">
<a id="home">to home</a>
</Link>
</>
)
}