[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

原文地址:https://www.cnblogs.com/Answer1215/p/5327629.html