Skip to content

Commit

Permalink
State is no longer used since #4156
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Apr 18, 2018
1 parent 65a9a63 commit a691dd0
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>`

<p><details>
Expand Down

0 comments on commit a691dd0

Please sign in to comment.