mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Remove some unwanted code.
This commit is contained in:
parent
65a2603917
commit
f6f175db73
|
@ -4,7 +4,6 @@ import { renderToString, renderToStaticMarkup } from 'react-dom/server'
|
|||
import send from 'send'
|
||||
import requireModule from './require'
|
||||
import resolvePath from './resolve'
|
||||
import readPage from './read-page'
|
||||
import { Router } from '../lib/router'
|
||||
import { loadGetInitialProps } from '../lib/utils'
|
||||
import Head, { defaultHead } from '../lib/head'
|
||||
|
@ -50,16 +49,7 @@ async function doRender (req, res, pathname, query, {
|
|||
Component = Component.default || Component
|
||||
Document = Document.default || Document
|
||||
const ctx = { err, req, res, pathname, query }
|
||||
|
||||
const [
|
||||
props,
|
||||
component,
|
||||
errorComponent
|
||||
] = await Promise.all([
|
||||
loadGetInitialProps(Component, ctx),
|
||||
readPage(join(dir, '.next', 'bundles', 'pages', page)),
|
||||
readPage(join(dir, '.next', 'bundles', 'pages', '_error'))
|
||||
])
|
||||
const props = await loadGetInitialProps(Component, ctx)
|
||||
|
||||
// the response might be finshed on the getinitialprops call
|
||||
if (res.finished) return
|
||||
|
@ -103,8 +93,6 @@ async function doRender (req, res, pathname, query, {
|
|||
err: (err && dev) ? errorToJSON(err) : null
|
||||
},
|
||||
dev,
|
||||
component,
|
||||
errorComponent,
|
||||
staticMarkup,
|
||||
...docProps
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue