[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.html

 

Using hashHistory:less

<Router history={hashHistory}>

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

 

Using browserHistory:this

<Router history={browserHistory}>

We still need server everytime to return us index.htmlurl

http://localhost:3333/contactspa

相關文章
相關標籤/搜索