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}