title: duplicate browserHistory react-router
body: <p>I have a problem with the following code:
  This code what it does is when typing up or down I change the path, and it works fine, but the problem is that every time it changes it doubles the browser, and causes the web page to be blocked</p>
  
  <pre><code>function homeChange(e){
  
    $(window).keydown(function(event) { 
      if(event.which==40){
        browserHistory.push('/aplicaciones_moviles');
        console.log(browserHistory)
      }
    });
  }
  function appServiceChange(){
    $(window).keydown(function(event) { 
      if(event.which==40){
        console.log(browserHistory)
        browserHistory.push('/software_medida');
      }else if(event.which==38){
        browserHistory.push('/aplicaciones_moviles');
        console.log(browserHistory)
      }
    });
  
  }
  function softwareServiceChange(){
    $(window).keydown(function(event) { 
      if(event.which==40){
        console.log(event)
        browserHistory.push('/portafolio');
      }else if(event.which==38){
        browserHistory.push('/aplicaciones_moviles');
      }
    });
  }
  
  function portafolioChange(){
    $(window).keydown(function(event) { 
      if(event.which==40){
        console.log(event)
        browserHistory.push('/');
      }else if(event.which==38){
        browserHistory.push('/software_medida');
      }
    });
  }
  
  export default class Routes extends Component {
    render() {
      return (
        &lt;Router history={browserHistory} &gt;
          &lt;Route path='/' component={HomeLayout} onEnter={homeChange} &gt;
            &lt;IndexRoute component={HomeComponent} /&gt;
          &lt;/Route&gt;
          &lt;Route path='aplicaciones_moviles' component={AppServiceLayout} onEnter={appServiceChange} &gt;
            &lt;IndexRoute  /&gt;
          &lt;/Route&gt;
          &lt;Route path='software_medida' component={softwareServiceLayout} onEnter={softwareServiceChange}&gt;
            &lt;IndexRoute  /&gt;
          &lt;/Route&gt;        
          &lt;Route path='portafolio' component={portafolioLayout} onEnter={portafolioChange}&gt;
            &lt;IndexRoute  /&gt;
          &lt;/Route&gt;
          &lt;Route path='*' component={HomeLayout}&gt;
            &lt;IndexRoute component={NotFoundComponent} /&gt;
          &lt;/Route&gt;
        &lt;/Router&gt;
      );
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w53Rm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w53Rm.png" alt="enter image description here"></a></p>