提交 9b02939c 编写于 作者: L Luis Fernando Alvarez D 提交者: Tim Neutkens

Define generic for _app state (#8256)

上级 11d2206c
......@@ -27,8 +27,9 @@ async function appGetInitialProps({
return { pageProps }
}
export default class App<P = {}, CP = {}> extends React.Component<
P & AppProps<CP>
export default class App<P = {}, CP = {}, S = {}> extends React.Component<
P & AppProps<CP>,
S
> {
static childContextTypes = {
router: PropTypes.object,
......
......@@ -58,7 +58,7 @@ export default class Document<P = {}> extends Component<DocumentProps & P> {
}
/**
* `getInitialProps` hook returns the context object with the addition of `renderPage`. `
* `getInitialProps` hook returns the context object with the addition of `renderPage`.
* `renderPage` callback executes `React` rendering logic synchronously to support server-rendering wrappers
*/
static async getInitialProps({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册