this.props.history.push works in some components and not others

This is the problem of Nested Components.
this.props.history.push won't work in nested components.
So Solution is to use withRouter .
To Use withRouter just copy paste Below 2 lines :
import { withRouter } from "react-router";
export default withRouter(connect(mapStateToProps, {
    ...
})(App));

Comments