1
0
Fork 0
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:
Xuezheng Ma 2017-05-19 15:02:01 -07:00 committed by Tim Neutkens
parent 23a480964e
commit d36118ab02

View file

@ -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,