Skip to content

Instantly share code, notes, and snippets.

@Restoration
Created November 25, 2019 08:25
Show Gist options
  • Select an option

  • Save Restoration/20e669c75fadcf116d53fd5fff5d82ce to your computer and use it in GitHub Desktop.

Select an option

Save Restoration/20e669c75fadcf116d53fd5fff5d82ce to your computer and use it in GitHub Desktop.
import { NextPage } from 'next'
import { withRouter } from 'next/router'
import { WithRouterProps } from 'next/dist/client/with-router'
interface Props {
books: Book[]
}
const Index : NextPage<WithRouterProps & Props> = () => {
return <div>
<p>Hello World</p>
</div>
}
index.getInitialProps = async ({req}) => {
// do something
}
export default withRouter(Index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment