// 如果使用hashHistory
import creatHistory from 'history/createHashHistory'
// 如果使用createBrowserHistory
import creatHistory from 'history/createBrowserHistory'
const history = creatHistory();
history.goBack();
下面的截图是打印history的结果:

相关API:https://reacttraining.com/react-router/web/api/history
最后
以上就是发嗲眼神最近收集整理的关于react项目—单击按钮返回上一页的全部内容,更多相关react项目—单击按钮返回上一页内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复