Files
react.dev/src/html.js
Alexander Nanberg 71b03486c0 Upgrade to Gatsby v2 (#1104)
* Upgrade to Gatsby v2

* Remove unnecessary polyfills since gatsby already provides them

* Move global styles to gatsby-browser

* Add fb comment and convert to cjs

* Revert to use pageQuery again

* Add back html.js

* Update dependencies

* Move TitleAndMetaTags

* Replace glamor/reset with normalize.css which fixes style order in prod

* Prettier formatting

* Remove unused types

* Remove old layout

* Fix versions link

* Update deps

* Update deps

* Remove hack since it's no longer needed

* Update dependencies

* Fix build error

* Fix prettier config resolution

* Update gatsby

* Remove custom onCreatePage logic

* Update dependencies

* Fix build

* Update dependencies

* prettier formatting

* update dependencies

* add custom babel config for flow

* upgrade dependencies

* update dependencies

* use stable gatsby release
2018-09-19 13:11:19 +01:00

38 lines
1.0 KiB
JavaScript

import React from 'react';
const JS_NPM_URLS = [
'//unpkg.com/docsearch.js@2.4.1/dist/cdn/docsearch.min.js',
];
export default class HTML extends React.Component {
render() {
return (
<html lang="en" {...this.props.htmlAttributes}>
<head>
{JS_NPM_URLS.map(url => (
<link key={url} rel="preload" href={url} as="script" />
))}
<meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<link rel="icon" href="/favicon.ico" />
{this.props.headComponents}
</head>
<body {...this.props.bodyAttributes}>
<div
id="___gatsby"
dangerouslySetInnerHTML={{__html: this.props.body}}
/>
{this.props.postBodyComponents}
{JS_NPM_URLS.map(url => (
<script key={url} src={url} />
))}
</body>
</html>
);
}
}