BrowserRouter和HashRouter的区别

原文链接: http://www.cnblogs.com/ruoshuisanqian/p/10291929.html

BrowserRouter:

  原理是H5的history API,IE9及以下不兼容,需要由web server支持,在web client这边window.location.pathname被react router解析,example.com/react/route

HashRouter:

  原理是URL的hash,不需要由web server支持,因为它的只有‘/’path需要由web server支持,而#/react/route URL不能被web server读取,在web client这边window,location.hash被react router解析,example.com/#/react/route

转载于:https://www.cnblogs.com/ruoshuisanqian/p/10291929.html

猜你喜欢

转载自blog.csdn.net/weixin_30414245/article/details/94843416