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:
parent
6ed2da4575
commit
36c82fd127
|
@ -114,7 +114,7 @@ async function doRender (req, res, pathname, query, {
|
||||||
|
|
||||||
if (isResSent(res)) return
|
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, {
|
const doc = createElement(Document, {
|
||||||
__NEXT_DATA__: {
|
__NEXT_DATA__: {
|
||||||
props,
|
props,
|
||||||
|
|
Loading…
Reference in a new issue