UNPKG

1.06 kBJavaScriptView Raw
1import React from "react"
2import PropTypes from "prop-types"
3
4export default function HTML(props) {
5 return (
6 <html {...props.htmlAttributes}>
7 <head>
8 <meta charSet="utf-8" />
9 <meta httpEquiv="x-ua-compatible" content="ie=edge" />
10 <meta
11 name="viewport"
12 content="width=device-width, initial-scale=1, shrink-to-fit=no"
13 />
14 {props.headComponents}
15 </head>
16 <body {...props.bodyAttributes}>
17 {props.preBodyComponents}
18 <noscript key="noscript" id="gatsby-noscript">
19 This app works best with JavaScript enabled.
20 </noscript>
21 <div
22 key={`body`}
23 id="___gatsby"
24 dangerouslySetInnerHTML={{ __html: props.body }}
25 />
26 {props.postBodyComponents}
27 </body>
28 </html>
29 )
30}
31
32HTML.propTypes = {
33 htmlAttributes: PropTypes.object,
34 headComponents: PropTypes.array,
35 bodyAttributes: PropTypes.object,
36 preBodyComponents: PropTypes.array,
37 body: PropTypes.string,
38 postBodyComponents: PropTypes.array,
39}