mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Check if _document.js returns a react element before using (#2013)
* Check if _document.js returns a react element before using * Use capital letter R in 'React'
This commit is contained in:
parent
23a480964e
commit
d36118ab02
|
@ -90,6 +90,7 @@ async function doRender (req, res, pathname, query, {
|
|||
|
||||
if (res.finished) return
|
||||
|
||||
if (!Document.prototype || !Document.prototype.isReactComponent) throw new Error('_document.js is not exporting a React element')
|
||||
const doc = createElement(Document, {
|
||||
__NEXT_DATA__: {
|
||||
props,
|
||||
|
|
Loading…
Reference in a new issue