After clicking the button, I want to change the component displayed on the screen. I have created a function called changeComp() within my component's class. However, when I click the button, it doesn't route to the wallet-connect component as expected. Can someone please assist me in understanding what I am doing wrong here or why this approach might be incorrect?
changeComp(){
return (
<Router>
<Switch>
<Route exact path="/wallet-connect" component={WalletConnect} />
</Switch>
</Router>
);}
<button className="btn w-100 mt-3 mt-sm-4" onClick={(event) => this.changeComp(event)} type="submit">Sign In</button>