码迷,mamicode.com
首页 > 其他好文 > 详细

[React] React Router: hashHistory vs browserHistory

时间:2016-03-28 07:06:18      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:

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

 

[React] React Router: hashHistory vs browserHistory

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!