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
19807262
Commit
19807262
authored
Dec 19, 2016
by
Guillermo Rauch
Committed by
GitHub
Dec 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
3c25bef2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
README.md
README.md
+4
-7
No files found.
README.md
View file @
19807262
...
@@ -286,20 +286,17 @@ import Document, { Head, Main, NextScript } from `next/document`
...
@@ -286,20 +286,17 @@ import Document, { Head, Main, NextScript } from `next/document`
export
default
class
MyDocument
extends
Document
{
export
default
class
MyDocument
extends
Document
{
static
async
getInitialProps
(
ctx
)
{
static
async
getInitialProps
(
ctx
)
{
const
props
=
await
Document
.
getInitialProps
(
ctx
)
const
props
=
await
Document
.
getInitialProps
(
ctx
)
// append a custom `value`
return
{
...
props
,
customValue
:
'hi there!'
}
return
{
...
props
,
value
:
'hi'
}
}
}
render
()
{
render
()
{
return
(
return
(
<
html
>
<
html
>
<
Head
>
<
Head
>
{
/* custom style */
}
<
style
>
{
`body { margin: 0 } /* custom! */`
}
</
style
>
<
style
>
{
`body { margin: 0 }`
}
</
style
>
</
Head
>
</
Head
>
{
/* set className to body */
}
<
body
className=
"custom_class"
>
<
body
className=
"hi"
>
{
this
.
props
.
customValue
}
{
this
.
props
.
value
}
<
Main
/>
<
Main
/>
<
NextScript
/>
<
NextScript
/>
</
body
>
</
body
>
...
...
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