8443a809f3
* Verify GS(S)P Serializability * Add support for cyclic refs * Add unit tests * Test for error in development mode * Fix prerender preview tests * Fix gssp preview tests * fix 2x test cases * Add desired test * fix some more tests * Fix route manifest expect * Fix test expects * Test that `getServerSideProps` does not error in production * Test that getStaticProps is not checked in production * Test serialization check during build * Fix export detection for serverless * Update test/unit/is-serializable-props.test.js Co-Authored-By: JJ Kasper <jj@jjsweb.site> Co-authored-by: JJ Kasper <jj@jjsweb.site>
21 lines
377 B
JavaScript
21 lines
377 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export async function getStaticProps() {
|
|
return {
|
|
props: { time: new Date() },
|
|
}
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
return { paths: [], fallback: true }
|
|
}
|
|
|
|
const Page = ({ time }) => {
|
|
const { isFallback } = useRouter()
|
|
|
|
if (isFallback) return null
|
|
|
|
return <p>hello {time.toString()}</p>
|
|
}
|
|
|
|
export default Page
|