From 7a08e1b5f89040743f8a3e463c2e56bc9ed68ac8 Mon Sep 17 00:00:00 2001 From: Roman Vanesyan Date: Fri, 24 Nov 2017 02:12:52 +0500 Subject: [PATCH] Remove extra div (#3327) * Replace extra div with React fragment. * Fix linter * Replace extra div with React fragment. * Fix linter * fix script tag, backport nonce attribute --- server/document.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/document.js b/server/document.js index 9af596c2..f1826f61 100644 --- a/server/document.js +++ b/server/document.js @@ -3,6 +3,10 @@ import PropTypes from 'prop-types' import htmlescape from 'htmlescape' import flush from 'styled-jsx/server' +function Fragment ({ children }) { + return children +} + export default class Document extends Component { static getInitialProps ({ renderPage }) { const { html, head, errorHtml, chunks } = renderPage() @@ -96,22 +100,18 @@ export class Head extends Component { } export class Main extends Component { - static propTypes = { - className: PropTypes.string - } - static contextTypes = { _documentProps: PropTypes.any } render () { const { html, errorHtml } = this.context._documentProps - const { className } = this.props + return ( -
+
-
+ ) } } @@ -159,7 +159,7 @@ export class NextScript extends Component { const { chunks, __NEXT_DATA__ } = this.context._documentProps let { assetPrefix, buildId } = __NEXT_DATA__ return ( -
+ {chunks.map((chunk) => (