score:1

I've added this to my App and it seems to receive changes when routes change. More reference here

class App extends React.Component {

  ...

  getInitialState() {
      return {
         lang: 'en' // default
      };
  }

  componentWillReceiveProps(props) {
      console.log('location: ', props.location.pathname);
      var newLang = props.location.pathname.split('/').shift();
      if(this.state.lang !== newLang) {
          this.setState({lang: newLang});
      }
  }

  render() {

    const lang = this.state.lang;

    return (
        <AboutPage language={lang} />
        <Support language={lang} />
    );
  }
}

If this doesn't work, you can also look into how two components talk to each other


Related Query

More Query from same tag