Article directory
1. The underlying principles are different:
BrowserRouter uses H5's history API,
不兼容IE9及以下版不
.
HashRouter uses the hash value of the URL.
2. The display form of path is different
In the path of BrowserRouter
没有#
, for example: localhost:300@/demo/test
The path of HashRouter包含#
, for example: localhost:3e@/#/demo/test
3. The impact on Lushan state parameters after refresh
(1).BrowserRouter
没有任何影响
, because the state is stored in the history object.
(2). HashRouter刷新后会导致路山state参数的丢失
.