mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Move nextdata into nextScript and make Main return a single el (#831)
This commit is contained in:
parent
5be9c04007
commit
c21531151f
|
@ -69,13 +69,8 @@ export class Main extends Component {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { html, __NEXT_DATA__, staticMarkup } = this.context._documentProps
|
||||
return <div>
|
||||
<div id='__next' dangerouslySetInnerHTML={{ __html: html }} />
|
||||
{staticMarkup ? null : <script dangerouslySetInnerHTML={{
|
||||
__html: `__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}; module={};`
|
||||
}} />}
|
||||
</div>
|
||||
const { html } = this.context._documentProps
|
||||
return <div id='__next' dangerouslySetInnerHTML={{ __html: html }} />
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,6 +84,9 @@ export class NextScript extends Component {
|
|||
let { buildId } = __NEXT_DATA__
|
||||
|
||||
return <div>
|
||||
{staticMarkup ? null : <script dangerouslySetInnerHTML={{
|
||||
__html: `__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}; module={};`
|
||||
}} />}
|
||||
{ staticMarkup ? null : <script type='text/javascript' src={`/_next/${buildId}/commons.js`} /> }
|
||||
{ staticMarkup ? null : <script type='text/javascript' src={`/_next/${buildId}/main.js`} /> }
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue