我需要知道如何编写代码以使用react-router通过onClick刷新页面
我尝试使用history.push,但不起作用。
这是我的代码:
onClick() {
this.props.history.push(`/a/${this.props.a}`);
// window.location.reload();
}
goPage() {
return (
<Button onClick={this.onClick}>
Begin
</Button>
);
}
如果有人知道,请建议我
谢谢
使用它来重新加载页面;
window.location.reload();