From 36c82fd1275f761232f652c6b8da6c7b03a2fb1b Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 24 Jun 2018 17:10:24 +0200 Subject: [PATCH] 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. --- server/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/render.js b/server/render.js index 90407dda..4eed7e77 100644 --- a/server/render.js +++ b/server/render.js @@ -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,