If you want to set the document title in React? You can use React Helmet:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import React from 'react' import ReactDOM from 'react-dom' class Doc extends React.Component{ componentDidMount(){ document.title = "Enter you title here" } render(){ return( <b> test </b> ) } } ReactDOM.render( <Doc />, document.getElementById('container') ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.