Skip to content

Commit

Permalink
Update _document.js (vercel#29930)
Browse files Browse the repository at this point in the history
adding {Head, Html, Main, NextScript} from 'next/document'
setting lang="en"

I find it very useful for loading external scripts, fonts or whatever you may need for a starter package



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
  • Loading branch information
2 people authored and natew committed Feb 16, 2022
1 parent 69b608c commit 4eea0d8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/with-styled-components/pages/_document.js
@@ -1,7 +1,18 @@
import Document from 'next/document'
import Document, { Head, Html, Main, NextScript } from 'next/document'
import { ServerStyleSheet } from 'styled-components'

export default class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head></Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet()
const originalRenderPage = ctx.renderPage
Expand Down

0 comments on commit 4eea0d8

Please sign in to comment.