Skip to content

Commit

Permalink
Check if _document.js returns a react element before using (#2013)
Browse files Browse the repository at this point in the history
* Check if _document.js returns a react element before using

* Use capital letter R in 'React'
  • Loading branch information
xuezhma authored and timneutkens committed May 19, 2017
1 parent 23a4809 commit d36118a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d36118a

Please sign in to comment.