Skip to content

Instantly share code, notes, and snippets.

@akinogu
Created December 6, 2021 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akinogu/8dd620e12807561c293105fb1539e193 to your computer and use it in GitHub Desktop.
Save akinogu/8dd620e12807561c293105fb1539e193 to your computer and use it in GitHub Desktop.
// pages/_document.tsx
import Document, { Html, DocumentContext, Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}
render() {
return (
<Html>
<Head>
<link rel='manifest' href='/manifest.json' />
<link
rel='apple-touch-icon'
href='/icons/icon-192x192.png'
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
export default MyDocument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment