Skip to content

Commit d10d80c

Browse files
Coobahaarunoda
authored andcommitted
Fix react-helmet example missing initial props (vercel#1598)
* Fix react-helmet example missing initial props * Fix semicolon
1 parent 7f05918 commit d10d80c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/with-react-helmet/pages/_document.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import Document, { Head, Main, NextScript } from 'next/document'
22
import Helmet from 'react-helmet'
33

44
export default class extends Document {
5-
static async getInitialProps ({ renderPage }) {
5+
static async getInitialProps (...args) {
6+
const documentProps = await super.getInitialProps(...args)
67
// see https://github.com/nfl/react-helmet#server-usage for more information
78
// 'head' was occupied by 'renderPage().head', we cannot use it
8-
return { ...renderPage(), helmet: Helmet.rewind() }
9+
return { ...documentProps, helmet: Helmet.rewind() }
910
}
1011

1112
// should render on <html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy