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:
parent
0e6d190706
commit
61894816ba
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue