I am working on web application using React and bootstrap. When it comes to applying button onClick, it takes me hard time to let my page being redirect to another. if afte
A very simple way to do this is by the following:
onClick={this.fun.bind(this)}
and for the function:
fun() { this.props.history.push("/Home"); }
finlay you need to import withRouter:
import { withRouter } from 'react-router-dom';
and export it as:
export default withRouter (comp_name);