提交 ebe39a63 编写于 作者: T thom 提交者: Tim Neutkens

Display errors when using glamor/server in a custom document (#3804)

上级 c92bc858
......@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const page = renderPage()
const styles = renderStatic(() => page.html)
const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles }
}
......
......@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const page = renderPage()
const styles = renderStatic(() => page.html)
const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles }
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册