From 4eea0d84745b42e42cb6fa1e333861464d4a3263 Mon Sep 17 00:00:00 2001 From: Leticijak <65724560+Leticijak@users.noreply.github.com> Date: Sat, 5 Feb 2022 17:06:47 -0500 Subject: [PATCH] Update _document.js (#29930) 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> --- examples/with-styled-components/pages/_document.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/with-styled-components/pages/_document.js b/examples/with-styled-components/pages/_document.js index 2a59afeb93c1..6c343842e4b8 100644 --- a/examples/with-styled-components/pages/_document.js +++ b/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 ( + + + +
+ + + + ) + } static async getInitialProps(ctx) { const sheet = new ServerStyleSheet() const originalRenderPage = ctx.renderPage