Pass an HOC to renderPage() (#2010)

* Added passing an HOC to renderPage()

* Remove gitignore
This commit is contained in:
Jay Cheroske 2017-08-21 14:15:14 -07:00 committed by Tim Neutkens
parent c689bc9f8b
commit 9c18c548bb

View file

@ -66,9 +66,9 @@ async function doRender (req, res, pathname, query, {
// the response might be finshed on the getinitialprops call // the response might be finshed on the getinitialprops call
if (res.finished) return if (res.finished) return
const renderPage = () => { const renderPage = (enhancer = Page => Page) => {
const app = createElement(App, { const app = createElement(App, {
Component, Component: enhancer(Component),
props, props,
router: new Router(pathname, query) router: new Router(pathname, query)
}) })