I know we use history.push() in functional component and react routing for redirection. But in class component how can we redirect on a button click
function onSubmit(){
console.log("Cannot use usehistory in this function as this is a class component")
}
//Link is not working in below code
<Link to ="/login">
<Button onClick={this.onSubmit}>Submit</Button>
</Link>