From d10d80ce3cdca4d791280dbd1d5fc923906a36c7 Mon Sep 17 00:00:00 2001 From: Alexander Ryzhikov Date: Mon, 3 Apr 2017 07:21:26 +0300 Subject: [PATCH] Fix react-helmet example missing initial props (#1598) * Fix react-helmet example missing initial props * Fix semicolon --- examples/with-react-helmet/pages/_document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/with-react-helmet/pages/_document.js b/examples/with-react-helmet/pages/_document.js index 58067835..dc90cf76 100644 --- a/examples/with-react-helmet/pages/_document.js +++ b/examples/with-react-helmet/pages/_document.js @@ -2,10 +2,11 @@ import Document, { Head, Main, NextScript } from 'next/document' import Helmet from 'react-helmet' export default class extends Document { - static async getInitialProps ({ renderPage }) { + static async getInitialProps (...args) { + const documentProps = await super.getInitialProps(...args) // see https://github.com/nfl/react-helmet#server-usage for more information // 'head' was occupied by 'renderPage().head', we cannot use it - return { ...renderPage(), helmet: Helmet.rewind() } + return { ...documentProps, helmet: Helmet.rewind() } } // should render on