title: React redux componentDidMount only runs once
body: <p>I'm using <code>react-redux</code> and <code>react-router-dom</code> to get navigation and state sorted in my application, but I've run into a problem. I have the following routes setup.</p>
  
  <pre><code>&lt;Provider store={this.store}&gt;
      &lt;BrowserRouter&gt;
          &lt;Switch&gt;
              &lt;Route path="/profile" component={Profile} store={this.store}/&gt;
              &lt;Route path="/clients" component={Clients} store={this.store}/&gt;
          &lt;/Switch&gt;
      &lt;/BrowserRouter&gt;
  &lt;/Provider&gt;
  </code></pre>
  
  <p>Then I have a child component called <code>Profile</code> which tries to read the context store. It works fine, but only the first time. I've simplified this as much as possible.</p>
  
  <pre><code>class Profile extends React.Component {
  
      constructor(props, context) {
      super(props, context);
      this.state = {};
  
  }
  
  componentDidMount() {
  
      console.log('Called once');
      this.store = this.context.store;
      this.unsubscribe = this.store.subscribe(() =&gt; {
  
          this.forceUpdate();
          const user = this.store.getState().profile.userDetails;
          this.setState({user});
  
      });
  }
  
  
  componentWillUnmount() {
  
      console.log('unsubscribe');
      this.unsubscribe();
  
  }
  </code></pre>
  
  <p>This means that once I navigate away from the page and come back, there is no store to use, so it cannot render the component. Can anyone advise on what I am missing here?</p>