import React, { Component, PropTypes } from 'react'
import htmlescape from 'htmlescape'
export default class Document extends Component {
static childContextTypes = {
_documentProps: PropTypes.any
}
getChildContext () {
return {
_documentProps: this.props
}
}
render () {
return
}
}
export function Head (props, context) {
const { head, css } = context._documentProps
const h = (head || [])
.map((h, i) => React.cloneElement(h, { key: '_next' + i }))
return
{h}
}
Head.contextTypes = { _documentProps: PropTypes.any }
export function Main (props, context) {
const { html, data, staticMarkup } = context._documentProps;
return
}
Main.contextTypes = { _documentProps: PropTypes.any }
export function DevTools (props, context) {
const { hotReload } = context._documentProps
return hotReload ? : null
}
DevTools.contextTypes = { _documentProps: PropTypes.any }
export function NextScript (props, context) {
const { dev, staticMarkup } = context._documentProps;
if (staticMarkup) return null
const src = !dev ? '/_next/next.bundle.js' : '/_next/next-dev.bundle.js'
return