title: How to redirect one page to another page in reactJS?
body: <blockquote>
    <p>App.js</p>
  </blockquote>
  
  <p>This is the event handling button click:</p>
  
  <pre><code>this.handleClick = this.handleClick.bind(this);
  
  
  handleClick(e) {
      debugger;
      e.preventDefault();
      this.context.router.history.push('/HomePage');
    }
  
  
  &lt;button onClick={this.handleClick}&gt;Navigate &lt;/button&gt;
  </code></pre>
  
  <blockquote>
    <p>TypeError: Cannot read property 'history' of undefined</p>
  </blockquote>
  
  <p>I installed this using: <code>npm install prop-types --save</code></p>
  
  <p>It's not working.</p>