1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

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

* Remove app variable as it’s only used once

* Remove double spread
This commit is contained in:
Tim Neutkens 2018-12-08 13:14:44 +01:00 committed by GitHub
parent 0e6d190706
commit 61894816ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()