Skip to content

Instantly share code, notes, and snippets.

@superhighfives
Created February 1, 2017 17:35
Show Gist options
  • Save superhighfives/27e8548abe27684070df41ac09479a43 to your computer and use it in GitHub Desktop.
Save superhighfives/27e8548abe27684070df41ac09479a43 to your computer and use it in GitHub Desktop.
An example of react-helmet with create-react-app
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;
@maxalmonte14
Copy link

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.

@Saro404
Copy link

Saro404 commented Oct 10, 2019

Can you please update the gist file with this one https://gist.github.com/Saro404/b0baab41e9685cb627a273d99186403f

@superhighfives
Copy link
Author

@MaXal

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