Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d10d80ce
Commit
d10d80ce
authored
Apr 03, 2017
by
Alexander Ryzhikov
Committed by
Arunoda Susiripala
Apr 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix react-helmet example missing initial props (#1598)
* Fix react-helmet example missing initial props * Fix semicolon
parent
7f059189
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
_document.js
examples/with-react-helmet/pages/_document.js
+3
-2
No files found.
examples/with-react-helmet/pages/_document.js
View file @
d10d80ce
...
@@ -2,10 +2,11 @@ import Document, { Head, Main, NextScript } from 'next/document'
...
@@ -2,10 +2,11 @@ import Document, { Head, Main, NextScript } from 'next/document'
import
Helmet
from
'react-helmet'
import
Helmet
from
'react-helmet'
export
default
class
extends
Document
{
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
// see https://github.com/nfl/react-helmet#server-usage for more information
// 'head' was occupied by 'renderPage().head', we cannot use it
// 'head' was occupied by 'renderPage().head', we cannot use it
return
{
...
renderPage
()
,
helmet
:
Helmet
.
rewind
()
}
return
{
...
documentProps
,
helmet
:
Helmet
.
rewind
()
}
}
}
// should render on <html>
// should render on <html>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment