1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix incorrect wording (#4658)

I can't use a functional component with `_document.js`.
[is-react](https://www.npmjs.com/package/is-react) can be used for another potential implementation of the warning logic, but maybe relying on `React.createElement()` internal checks is enough.
This commit is contained in:
Olivier Tassinari 2018-06-24 17:10:24 +02:00 committed by Tim Neutkens
parent 6ed2da4575
commit 36c82fd127

View file

@ -114,7 +114,7 @@ async function doRender (req, res, pathname, query, {
if (isResSent(res)) return
if (!Document.prototype || !Document.prototype.isReactComponent) throw new Error('_document.js is not exporting a React element')
if (!Document.prototype || !Document.prototype.isReactComponent) throw new Error('_document.js is not exporting a React component')
const doc = createElement(Document, {
__NEXT_DATA__: {
props,