提交 d10d80ce 编写于 作者: A Alexander Ryzhikov 提交者: Arunoda Susiripala

Fix react-helmet example missing initial props (#1598)

* Fix react-helmet example missing initial props

* Fix semicolon
上级 7f059189
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册