Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack
现象
在用`mobx-react-router`的`this.props.history.push("/")`的时候,浏览器会提示 Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack
解决
原因:这个是 reactr-router 的一个提示,当前路由下的 history 不能 push 相同的路径到 stack里。只有开发环境存在,生产环境不存在,目前还没看到官方有去掉的意思。看不惯的话可以采取一些方法关掉这个提示。
<Link to={{ pathname: "/" }} replace>detail</Link> 或者 this.props.history.replace("/");
参考
https://www.npmjs.com/package/mobx-react-router
Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack的更多相关文章
- react 记录:React Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack
前言: react-router-dom 4.4.2 在页面中直接使用 import { Link } from 'react-router-dom' //使用 <Link to={{ path ...
- Hash history cannot PUSH the same path; a new entry will not be added to the history stack
这个是reactr-router的一个提示,当前路由下的history不能push相同的路径.只有开发环境存在,生产环境不存在,目前还没看到官方有去掉的意思.看不惯的话可以采取一些方法关掉这个提示.具 ...
- warning malformed '#pragma pack(push[, id], n)' - ignored
bmp.c:8: warning: malformed '#pragma pack(push[, id], <n>)' - ignored bmp.c:33: warning: #prag ...
- Build path contains duplicate entry
问题:Build path contains duplicate entry:''D:soft/Myeclipse 6.5/jre/lib/rt.jar' for project 'dataServi ...
- perl hash array 嵌套 push
$hash{"A"}=["pp"];想变成:$hash{"A"}=["p","q"];因为 $has ...
- build path contains duplicate entry:'src' for project 'XXX'
解决了,原因是编译器配置不正确,原工程使用adk8/android2.3,我用的是最新的4.0,改了下编译环境就好了.
- XCode warning:“View Controller” is unreachable because it has no entry points
Unsupported Configuration: “View Controller” is unreachable because it has no entry points, and no i ...
- React 项目使用 React-router-dom 4.0 以上版本时使用 HashRouter 怎么控制 history
不添加 history 时,来回点击 Link 会在控制台报错如下 Warning: Hash history cannot PUSH the same path; a new entry will ...
- react-router分析 - 一、history
react-router基于history库,它是一个管理js应用session会话历史的js库.它将不同环境(浏览器,node等)的变量统一成了一个简易的API来管理历史堆栈.导航.确认跳转.以及s ...
随机推荐
- 查看java的jar包源码
1.jd-gui (windows环境) 下载地址 https://files.cnblogs.com/files/indifferent/jd-gui-windows-1.5.1.zip 下载并解压 ...
- info命令
info命令也可以查看命令的信息,但是和man命令不同,info命令如同一本书,一个命令只不过是书中的一个章节. 1.基本结构: 输入:info ls ls命令只不过是整个文档的10.1章节. 而在章 ...
- Springboot如何优雅的解决ajax+自定义headers的跨域请求[转]
1.什么是跨域 由于浏览器同源策略(同源策略,它是由Netscape提出的一个著名的安全策略.现在所有支持JavaScript 的浏览器都会使用这个策略.所谓同源是指,域名,协议,端口相同.),凡是发 ...
- CSS3 过渡 (transition )
transition 属性是一个简写属性,用于设置四个过渡属性: 1.transition-property 设置过渡效果的 CSS 属性的名称.一般写all 2.transition-durat ...
- 共享库的使用(.so)文件
1.共享库的概念 2.创建共享库命令 gcc -shared -fpci -o lib/libmath.so obj/mymath.o 具体加不加 fpci 这个要看平台支持吧支持:具体详情可以查阅 ...
- CODE FESTIVAL 2016 Final 题解
传送门 \(A\) 什么玩意儿-- const char c[]={"snuke"}; char s[15];int n,m; int main(){ scanf("%d ...
- 使用Android的日志工具Log
Android中的日志工具类是Log,这个类中提供了5个方法来供我们打印日志 1.Log.v()用于打印那些最为琐碎的,意义最小的日志信息.对应级别verbose,是Android日志里面级别最低的一 ...
- 使用composer下载依赖包下载失败的解决方法
下载好的composer默认的下载地址是国外的,在下载的过程中网络不好或者可能被墙,将下载的地址换成国内的地址即可 有两种方式启用本镜像服务: 系统全局配置: 即将配置信息添加到 Composer 的 ...
- GO语言Error处理
Go语言没有提供像Java.C#.Python语言中的try...catch异常处理方式,而是通过函数返回值逐层往上抛.好处就是避免漏掉本应处理的错误.坏处是代码啰嗦. 错误与异常区别 错误指的是可能 ...
- 文献阅读 | Epigenetics in ENS development and Hirschsprung disease
系列篇: Epigenetics in ENS development and Hirschsprung disease - Review Epigenetic Mechanisms in Hirsc ...