I was having a button in a react class component as following
<Link to="display">
<button onClick={this.nextBtn} className="nextBtn">
Submit
</button>
</Link>
By clicking the button, I need to route it to another component called <Display /> using the function nextBtn = () => {}.
I saw that in the function component it can be by useHistory but in the class component, I don't know how to do it.