问题描述
使用react-router-dom的HashRouter创建路由,用于Link进行跳转,如何返回上一层并且不刷新页面
问题出现的环境背景及自己尝试过哪些方法
"react-router-dom": "^4.3.1"
使用window.history.go(-1)返回会重新加载页面
相关代码
<HashRouter>
<div>
<Route path="/" exact component={Supermarket} />
<Route path="/app/:mID" exact component={App} />
</div>
</HashRouter>
<Link to={'/app/'+item.marketInfoId}>
点击跳转到app页面
</Link>
this.props.history.goBack()