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

17 lines
674 B
JavaScript
Raw Normal View History

2016-10-17 08:08:53 +00:00
import React from 'react'
2016-10-05 23:52:50 +00:00
import htmlescape from 'htmlescape'
2016-10-17 08:08:53 +00:00
export default ({ head, css, html, data, dev, staticMarkup }) => {
return <html>
<head>
{(head || []).map((h, i) => React.cloneElement(h, { key: i }))}
<style data-aphrodite='' dangerouslySetInnerHTML={{ __html: css.content }} />
</head>
<body>
<div id='__next' dangerouslySetInnerHTML={{ __html: html }} />
{staticMarkup ? null : <script dangerouslySetInnerHTML={{ __html: '__NEXT_DATA__ = ' + htmlescape(data) }} />}
{staticMarkup ? null : <script type='text/javascript' src={dev ? '/_next/next-dev.bundle.js' : '/_next/next.bundle.js'} />}
</body>
</html>
2016-10-05 23:52:50 +00:00
}