未验证 提交 9adf3bb6 编写于 作者: J Joe Haddad 提交者: GitHub

Improve Document Component Error (#17047)

上级 d113c640
......@@ -6,7 +6,32 @@ In your custom `pages/_document` an expected sub-component was not rendered.
#### Possible Ways to Fix It
Make sure to import and render all of the expected `Document` components.
Make sure to import and render all of the expected `Document` components:
- `<Html />`
- `<Head />`
- `<Main />`
- `<NextScript />`
For example:
```tsx
import Document, { Html, Head, Main, NextScript } from 'next/document'
export default class MyDocument extends Document {
render() {
return (
<Html>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
```
### Useful Links
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册