Correct the usage of title as a component

Documentation for this feature can be found [here](https://github.com/nfl/react-helmet#as-react-components)
This commit is contained in:
Vincent Taverna 2016-11-24 00:10:23 -05:00 committed by GitHub
parent e477a106e6
commit 67696ac08b

View File

@ -11,7 +11,7 @@ module.exports = React.createClass({
}, },
render() { render() {
const {body, route} = this.props const {body, route} = this.props
const head = Helmet.rewind() const {title} = Helmet.rewind()
const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' /> const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' />
let css let css
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
@ -24,9 +24,7 @@ module.exports = React.createClass({
<meta charSet="utf-8" /> <meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" /> <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=5.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=5.0" />
<title> { title.toComponent() }
{ head.title }
</title>
{ font } { font }
{ css } { css }
</head> </head>