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
446 B
JavaScript
21 lines
446 B
JavaScript
export function getStaticProps({ preview, previewData }) {
|
|
return {
|
|
props: {
|
|
hasProps: true,
|
|
preview: !!preview,
|
|
previewData: previewData || null,
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function({ hasProps, preview, previewData }) {
|
|
if (!hasProps) {
|
|
return <pre id="props-pre">Has No Props</pre>
|
|
}
|
|
|
|
return (
|
|
<pre id="props-pre">
|
|
{JSON.stringify(preview) + ' and ' + JSON.stringify(previewData)}
|
|
</pre>
|
|
)
|
|
}
|