Unverified Commit 61894816 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove app variable as it’s only used once (#5842)

* Remove app variable as it’s only used once

* Remove double spread
parent 0e6d1907
......@@ -83,14 +83,6 @@ async function doRender (req, res, pathname, query, {
}
}
const app = <LoadableCapture report={moduleName => reactLoadableModules.push(moduleName)}>
<EnhancedApp {...{
Component: EnhancedComponent,
router,
...props
}} />
</LoadableCapture>
const render = staticMarkup ? renderToStaticMarkup : renderToString
let html
......@@ -101,7 +93,15 @@ async function doRender (req, res, pathname, query, {
const ErrorDebug = require(join(distDir, SERVER_DIRECTORY, 'error-debug')).default
html = render(<ErrorDebug error={err} />)
} else {
html = render(app)
html = render(
<LoadableCapture report={moduleName => reactLoadableModules.push(moduleName)}>
<EnhancedApp
Component={EnhancedComponent}
router={router}
{...props}
/>
</LoadableCapture>
)
}
} finally {
head = Head.rewind() || defaultHead()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment