import Link from 'next/link' import { useRouter } from 'next/router' import Layout from '../components/Layout' import List from '../components/List' import { User } from '../interfaces' import { findAll } from '../utils/sample-api' type Props = { items: User[] pathname: string } const WithInitialProps = ({ items }: Props) => { const router = useRouter() return (

List Example (as Function Component)

You are currently on: {router.pathname}

Go home

) } export async function getStaticProps() { const items: User[] = await findAll() return { props: { items } } } export default WithInitialProps