Commit 36c82fd1 authored by Olivier Tassinari's avatar Olivier Tassinari Committed by Tim Neutkens

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.
parent 6ed2da45
...@@ -114,7 +114,7 @@ async function doRender (req, res, pathname, query, { ...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment