mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fix react-helmet example missing initial props (#1598)
* Fix react-helmet example missing initial props * Fix semicolon
This commit is contained in:
parent
7f0591896a
commit
d10d80ce3c
|
@ -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 <html>
|
||||
|
|
Loading…
Reference in a new issue