Skip to content
loading...

Change the document title on react application

github logo ・1 min read  

As a beginner in react, i developed the application by running the one command create-react-app.

By default, the app will be generated with the below title

<title>React App</title>

And it's pretty simple to change, just by having this life-cycle hook into your app file

  componentDidMount() {
    document.title = 'Custom Title';
  }

Now your application title will be changed to your custom title

twitter logo DISCUSS (2)
markdown guide
 

I am wondering whether it'd affect SEO score in anyway, either positively or negatively.

 

I am not sure about this, but i would say the impact may be for a certain period until the new title is getting crawled by the search engine bots.

Classic DEV Post from Feb 14

Which Techie Are You?

Our desks tell a lot about ourselves, don't they? What is your style?

Thillai Narayanan profile image
Dev since 2006, now interested to learn Machine Learning