小编典典

react路由器中的hashHistory和browserHistory有什么区别?

reactjs

我已经用谷歌搜索了很多,但是我没有找到以下问题的明确答案:react-router中的hashHistory和browserHistory有什么区别?


阅读 347

收藏
2020-07-22

共1个答案

小编典典

基本区别在于hashHistory使用的URL类似于:http
://myurl.com/#page/another_page/another_page

使用BrowserHistory,您可以获得正常的网址(无哈希):http
:
//myurl.com/page/another_page/another_page

2020-07-22