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
01b34bb7
Commit
01b34bb7
authored
Dec 03, 2018
by
Peter Halasz
Committed by
Tim Neutkens
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format no-document-title description (#5803)
parent
977bf8d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
no-document-title.md
errors/no-document-title.md
+12
-9
No files found.
errors/no-document-title.md
View file @
01b34bb7
...
@@ -6,7 +6,7 @@ Adding `<title>` in `pages/_document.js` will lead to unexpected results with `n
...
@@ -6,7 +6,7 @@ Adding `<title>` in `pages/_document.js` will lead to unexpected results with `n
#### Possible Ways to Fix It
#### Possible Ways to Fix It
Set
`<title>`
in
`pages/_app.js`
instead
:
Set
`<title>`
in
`pages/_app.js`
instead:
```
js
```
js
// pages/_app.js
// pages/_app.js
...
@@ -22,17 +22,20 @@ export default class MyApp extends App {
...
@@ -22,17 +22,20 @@ export default class MyApp extends App {
pageProps
=
await
Component
.
getInitialProps
(
ctx
)
pageProps
=
await
Component
.
getInitialProps
(
ctx
)
}
}
return
{
pageProps
}
return
{
pageProps
}
}
}
render
()
{
render
()
{
const
{
Component
,
pageProps
}
=
this
.
props
const
{
Component
,
pageProps
}
=
this
.
props
return
<
Container
>
<
Head
>
return
(
<
title
>
My
new
cool
app
<
/title
>
<
Container
>
<
/Head
>
<
Head
>
<
Component
{...
pageProps
}
/
>
<
title
>
My
new
cool
app
<
/title
>
<
/Container
>
<
/Head
>
<
Component
{...
pageProps
}
/
>
<
/Container
>
)
}
}
}
}
```
```
...
...
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