Created
February 1, 2017 17:35
-
-
Save superhighfives/27e8548abe27684070df41ac09479a43 to your computer and use it in GitHub Desktop.
An example of react-helmet with create-react-app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Helmet from 'react-helmet'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<Helmet title="You Are Doing Great" /> | |
<div className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h2>Welcome to React</h2> | |
</div> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. | |
</p> | |
</div> | |
); | |
} | |
} | |
export default App; |
Can you please update the gist file with this one https://gist.github.com/Saro404/b0baab41e9685cb627a273d99186403f
Yeah, but about if you want to change some metadata from another component, like the
title
for example, here you're just passing it as a static text.
You can reference <Helmet title="..." />
in any view, @maxalmonte14.
Can you please update the gist file with this one https://gist.github.com/Saro404/b0baab41e9685cb627a273d99186403f
I appreciate the message, but why the change, @Saro404?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, but about if you want to change some metadata from another component, like the
title
for example, here you're just passing it as a static text.