[React] React Router: hashHistory vs browserHistory


In this lesson we'll look at hashHistory which uses a hash hack to track our route changes vs browserHistory which delivers clean urls, but requires server work to implement.

 

Using hashHistory:

<Router history={hashHistory}>

http://localhost:3333/#/contact?_k=0lz6yy

 

Using browserHistory:

<Router history={browserHistory}>

We still need server everytime to return us index.html

http://localhost:3333/contact

 


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com