import React from "react"; import { GetStaticPropsContext } from "next"; type IndexPageProps = { name: string; preview: boolean; }; export default function IndexPage(props: IndexPageProps): JSX.Element { return ( {`Hello ${props.name}! This is an SSG Page using getStaticProps().`}

{String(props.preview)}

); } export function getStaticProps(ctx: GetStaticPropsContext): { props: IndexPageProps; } { return { props: { name: "serverless-next.js", preview: !!ctx.preview } }; }