Skip to content

Commit

Permalink
fix: gatsby v2 removes need to manually inline styles
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisJT committed Jul 2, 2019
1 parent 402563e commit fe69f2a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/html.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';

let stylesStr;
if (process.env.NODE_ENV === `production`) {
try {
// eslint-disable-next-line global-require
stylesStr = require(`!raw-loader!../public/styles.css`);
} catch (error) {
console.log(error);
}
}

export default class HTML extends PureComponent {
static propTypes = {
body: PropTypes.node.isRequired,
Expand All @@ -21,11 +11,6 @@ export default class HTML extends PureComponent {
render() {
const {body, headComponents, postBodyComponents} = this.props;

let css;
if (process.env.NODE_ENV === `production`) {
css = <style id="gatsby-inlined-css" dangerouslySetInnerHTML={{__html: stylesStr}} />;
}

return (
<html lang="en">
<head>
Expand All @@ -39,7 +24,6 @@ export default class HTML extends PureComponent {

<meta name="apple-mobile-web-app-title" content="harrisjt" />
<meta content="IE=edge" httpEquiv="X-UA-Compatible" />
{css}
</head>
<body>
<div dangerouslySetInnerHTML={{__html: body}} id="___gatsby" />
Expand Down

0 comments on commit fe69f2a

Please sign in to comment.