title: React JS : history.push is not a function error and it isn't navigating to a different page onclick of swal
body: <p>I have been using react js for the past couple of months and just got to know about the sweetalert bootstrap plugin for react. on update of a component successfully a dialog appears onscreen. upon clicking the "click here" button history.push is invoked and it should route to a different page but I have been getting error</p>
  
  <blockquote>
    <p>history.push is not defined.</p>
  </blockquote>
  
  <p>I have googled quite a few stuff and tried quite a few scenarios but haven't been successful in it.</p>
  
  <p>code snippet:</p>
  
  <pre><code>class displayBlank extends Component {
  
  render(){
  
  &lt;div id="displayDetails"&gt;
            &lt;DisplayDetails respData={this.state.respData}  /&gt;
          &lt;/div&gt;
  
  }
  
  }
  
  export default displayBlank;
  
  
  class displayDetails{
  
   handleUpdate()
   {
  
    // Body of HandleUpdate
      swal({
        title :"Customer Updated Successfully!",
        icon : "success",
        button: "Click Here!",
      }).then((e) =&gt; { history.push('/blank');
    });
  
    }
  
    render(){
  
    &lt;table&gt;
    &lt;tr&gt;
    &lt;td&gt;
  
     Table-Grid Contents
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
  
    &lt;td&gt;
                &lt;FormGroup controlId="formControlsDisabledButton"  style={buttonalignment}&gt;
                  &lt;Button className="float-right" bsStyle="primary" type="submit" onClick={this.handleUpdate}&gt;Save&lt;/Button&gt;
                  {'  '}
                  &lt;Button className="float-right" bsStyle="primary" type="submit" disabled&gt;Download&lt;/Button&gt;
                  {'  '}
                &lt;/FormGroup&gt;
              &lt;/td&gt;
  
  
    }
  
  }  
  </code></pre>