提交 a691dd06 编写于 作者: T Tim Neutkens

State is no longer used since #4156

上级 65a9a63a
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册