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
a691dd06
Commit
a691dd06
authored
Apr 18, 2018
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
State is no longer used since #4156
parent
65a9a63a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
30 deletions
+0
-30
readme.md
readme.md
+0
-30
No files found.
readme.md
View file @
a691dd06
...
@@ -990,36 +990,6 @@ export default class MyApp extends App {
...
@@ -990,36 +990,6 @@ export default class MyApp extends App {
}
}
```
```
When using state inside app the
`hasError`
property has to be defined:
```
js
import
App
,
{
Container
}
from
'next/app'
import
React
from
'react'
export
default
class
MyApp
extends
App
{
static
async
getInitialProps
({
Component
,
router
,
ctx
})
{
let
pageProps
=
{}
if
(
Component
.
getInitialProps
)
{
pageProps
=
await
Component
.
getInitialProps
(
ctx
)
}
return
{
pageProps
}
}
state
=
{
hasError
:
null
}
render
()
{
const
{
Component
,
pageProps
}
=
this
.
props
return
<
Container
>
<
Component
{...
pageProps
}
/
>
<
/Container
>
}
}
```
### Custom `<Document>`
### Custom `<Document>`
<p><details>
<p><details>
...
...
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