mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
22 lines
392 B
JavaScript
22 lines
392 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export async function getStaticProps() {
|
|
return {
|
|
props: { time: new Date() },
|
|
}
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
return { paths: [], fallback: 'blocking' }
|
|
}
|
|
|
|
const Page = ({ time }) => {
|
|
const { isFallback } = useRouter()
|
|
|
|
if (isFallback) return null
|
|
|
|
return <p>hello blocking {time.toString()}</p>
|
|
}
|
|
|
|
export default Page
|