title: React browserHistory.push giving Uncaught TypeError: Cannot read property 'push' of undefined
body: <p>I am trying to change the page on click.
  Here is the click function</p>
  
  <pre><code>import React, { Component } from 'react';
  import {BrowserRouter as Router,Route} from 'react-router-dom';
  import { browserHistory } from 'react-router';
  class Buttons extends Component {
  skipClick(){
      browserHistory.push('/sessionstate2');
  }
  render() {
  return (&lt;a className={skipShow} onClick={this.skipClick}&gt;Skip&lt;/a&gt;)
  }
  }
  </code></pre>
  
  <p>and index.js</p>
  
  <pre><code>import browserHistory from 'react-router';
  ReactDOM.render(
      &lt;Router history={browserHistory}&gt;
      &lt;div&gt;
        &lt;Route exact path="/" component={App} /&gt;
        &lt;Route exact path="/sessionstate1" component={Template1}/&gt;
        &lt;Route exact path="/sessionstate2" component={Template2}/&gt;
        &lt;Route exact path="/sessionstate3" component={Template3}/&gt;
  &lt;/div&gt;
    &lt;/Router&gt;,
     document.getElementById('root')
   );
  </code></pre>
  
  <p>It is giving</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'push' of undefined</p>
  </blockquote>
  
  <p>Can you please tell me what am I doing wrong here?</p>