title: How push route to another path in react-redux connected component
body: <p>i wan't to make conditional routing in my component. I'm using react-redux. I have tried different things like but getting undefined error.</p>
  
  <pre><code>this.props.history.push('/pathname')
  </code></pre>
  
  <p>so what i wan't to do, on component will mount i'm checking some boolean value from my redux state if this value will return false i want to redirect user to another route. </p>
  
  <p>my component is: </p>
  
  <pre><code>import React, {Component} from 'react'
  import { connect } from 'react-redux';
  import { bindActionCreators } from 'redux'
  
  class SomeComponent extends Component {
  componentWillMount() {
          this.props.someFunc()
          if ( this.props.userLogin[0].isUserLogin === false ) {
              /// here i want to redirect to another route 
          } 
      }
  render() {
     return(
       &lt;div&gt;Some Content&lt;/div&gt;
     )
    }
  }
  
  const mapStateToProps = state =&gt; ({
      userLogin: state.UserLogin,
    })
  
    function mapDispatchToProps(dispatch) {
      return {
        someFunc: bindActionCreators(someAction, dispatch)
      }
    } 
  
    export default connect(mapStateToProps, mapDispatchToProps)(SomeComponent)
  </code></pre>
  
  <p>Like in example i want to redirect in component will mount user to another path. How i can do that?</p>