Skip to content

Commit d06f926

Browse files
committed
No helmet, use script tags
1 parent d68cb99 commit d06f926

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

client/containers/App/index.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
import React, { Component, PropTypes } from 'react';
22
import Toolbar from 'components/Toolbar';
3-
import Helmet from 'react-helmet';
43
import './style.scss';
54

6-
export default class App extends Component {
7-
constructor(props) {
8-
super(props);
9-
this.state = {
10-
preload: []
11-
};
12-
}
5+
const tag = document.createElement('script');
6+
tag.async = 1;
137

8+
const addScript = src => {
9+
tag.src = src;
10+
document.head.appendChild(tag.cloneNode());
11+
};
12+
13+
export default class App extends Component {
1414
componentDidMount() {
15-
this.setState({
16-
preload: window.__CHUNKS.map(chunk => ({ href: chunk, rel: 'preload', as: 'script' }))
17-
});
15+
window.__CHUNKS.forEach(addScript);
1816
}
1917

2018
render() {
2119
return (
2220
<main className="viewport">
23-
<Helmet link={this.state.preload} />
2421
<Toolbar />
2522
{this.props.children}
2623
</main>

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"babel-runtime": "^6.16.0",
3333
"react": "^15.3.0",
3434
"react-dom": "^15.3.0",
35-
"react-helmet": "^3.2.2",
3635
"react-router": "^2.8.0"
3736
}
3837
}

webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ module.exports = {
110110
vendor: [
111111
'react',
112112
'react-dom',
113-
'react-helmet'
114113
]
115114
},
116115
output: {

0 commit comments

Comments
 (0)