score:1

Accepted answer

When you do client side navigation you'll need to manually update the title of the page using document.title. The server will only inject the title when you make fresh page requests.

Let's say this is the Contact component...

class Contact extends React.Component {

  componentDidMount() {
    // this only executes on the browser, not server
    document.title = 'Contact Page';
  }
  
  // you could also use this to inject props
  componentWillReceiveProps(nextProps) {
    document.title = `Contact Page - ${nextProps.someValue}`;
  }
  
  render() {
    ...
  }
}

There are also open source components that can do this for you, like react-document-title.


Related Query

More Query from same tag