title: React Router goBack function has to be executed twice
body: <p>I'm starting to learn  react router, and I'm having some issues, with using the goBack function, which is inside the history property in React Router. </p>
  
  <p>I have a simple route, where I render a dummy post, form the JsonPlaceHolder API, and make a button to go back, which executes this function.</p>
  
  <pre><code>   returnToForwardPageHandler = () =&gt;{
      this.props.history.goBack(); 
  }
  </code></pre>
  
  <p>now the post is loaded dynamically, depending on the ID, which is given. </p>
  
  <pre><code> componentDidMount () {
      if(this.props.match.params.id){
          if ( !this.state.loadedPost || (this.state.loadedPost &amp;&amp; this.state.loadedPost.id !== this.props.id) ) {
              axios.get( 'https://jsonplaceholder.typicode.com/posts/' + this.props.match.params.id)
                  .then( response =&gt; {
                      // console.log(response);
                      this.setState( { loadedPost: response.data 
                  } );
                  } );
              }
          }
      }
  </code></pre>
  
  <p>but I do get a different result depending on how the id is given. </p>
  
  <p>In my component, where the id is sat, of the given post</p>
  
  <pre><code>  postSelectedHandler = (id) =&gt; {
      //this.setState({selectedPostId: id});
      this.props.history.push('/' + id)
  }
  </code></pre>
  
  <p>it works fine if I set the state manually of the id. But I have to click the button (execute the returnToForwardPageHandler function) twice if I use this.props.history.push('/' + id), shouldn't the outcome be the same, what am I missing?</p>