【问题标题】:React router hashHistory explainedReact 路由器 hashHistory 解释
【发布时间】:2017-02-26 02:31:39
【问题描述】:

从这里引用https://github.com/reactjs/react-router-tutorial/blob/master/lessons/02-rendering-a-route/README.md

我们正在使用 hashHistory——它使用哈希管理路由历史 网址的一部分。它有额外的垃圾来缓冲一些行为 浏览器在使用真实网址时本机具有。我们将把它改成使用 真正的网址稍后会丢失垃圾,但现在,这很好用 因为它不需要任何服务器端配置

谁能解释一下这是什么意思?

这是初学者应该明白的吗? (这似乎是一个初学者教程。)

【问题讨论】:

标签: react-router browser-history shim


【解决方案1】:

hashhistory 使用哈希模拟一个不错的 url 符号

example.com/#/some/path

而 browserHistory 使用 History api 来创建一个这样的 url:

example.com/some/path

您可以在这里参考:https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md

【讨论】:

  • 链接当前已断开。
  • 哈希的含义是什么?为什么不一样?
猜你喜欢
  • 2018-12-06
  • 2016-07-17
  • 1970-01-01
  • 2017-04-28
  • 2017-01-06
  • 2017-04-17
  • 1970-01-01
  • 1970-01-01
  • 2017-04-12
相关资源
最近更新 更多