Skip to content

Instantly share code, notes, and snippets.

@elzup
Last active July 5, 2023 12:42
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elzup/db2229b132ccda46d4ac3b25a52b60b7 to your computer and use it in GitHub Desktop.
Save elzup/db2229b132ccda46d4ac3b25a52b60b7 to your computer and use it in GitHub Desktop.
Next.js with typescript minimum pages/_document.tsx, pages/_app.tsx
import { AppProps } from 'next/app'
import Head from 'next/head'
const App = ({ Component, pageProps }: AppProps) => (
<>
<Head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="shortcut icon" href="/favicon.png" key="shortcutIcon" />
<link rel="manifest" href="/manifest.json" />
</Head>
<Component {...pageProps} />
</>
)
export default App
import NextDocument, { Html, Head, Main, NextScript } from 'next/document'
import React from 'react'
type Props = {}
class Document extends NextDocument<Props> {
render() {
return (
<Html>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
export default Document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment