I would like to be able to click a button and navigate to another page on the site.
I have tried to use the code from this page but cannot make it fit into my code. I have also got this code from another page.
Any help appreciated.
import React from 'react';
class Home extends React.Component{
constuctor() {
this.routeChange = this.routeChange.bind(this);
}
routeChange() {
let path = '/CreateAccount';
this.props.history.push(path);
}
render(){
return(
<div>
<p>
<button
onClick={this.routeChange}
class="btn btn-lg btn-gradient"
>
Signup
</button></p>
</div>
)
}
}