现象

在用`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的更多相关文章

  1. 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 ...

  2. Hash history cannot PUSH the same path; a new entry will not be added to the history stack

    这个是reactr-router的一个提示,当前路由下的history不能push相同的路径.只有开发环境存在,生产环境不存在,目前还没看到官方有去掉的意思.看不惯的话可以采取一些方法关掉这个提示.具 ...

  3. warning malformed '#pragma pack(push[, id], n)' - ignored

    bmp.c:8: warning: malformed '#pragma pack(push[, id], <n>)' - ignored bmp.c:33: warning: #prag ...

  4. Build path contains duplicate entry

    问题:Build path contains duplicate entry:''D:soft/Myeclipse 6.5/jre/lib/rt.jar' for project 'dataServi ...

  5. perl hash array 嵌套 push

    $hash{"A"}=["pp"];想变成:$hash{"A"}=["p","q"];因为 $has ...

  6. build path contains duplicate entry:'src' for project 'XXX'

    解决了,原因是编译器配置不正确,原工程使用adk8/android2.3,我用的是最新的4.0,改了下编译环境就好了.

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

  8. React 项目使用 React-router-dom 4.0 以上版本时使用 HashRouter 怎么控制 history

    不添加 history 时,来回点击 Link 会在控制台报错如下 Warning: Hash history cannot PUSH the same path; a new entry will ...

  9. react-router分析 - 一、history

    react-router基于history库,它是一个管理js应用session会话历史的js库.它将不同环境(浏览器,node等)的变量统一成了一个简易的API来管理历史堆栈.导航.确认跳转.以及s ...

随机推荐

  1. Hive 调优

    今天总结本人在使用Hive过程中的一些优化技巧,希望给大家带来帮助.Hive优化最体现程序员的技术能力,面试官在面试时最喜欢问的就是Hive的优化技巧. 技巧1.控制reducer数量 下面的内容是我 ...

  2. 解决VS2010自带的C/C++编译器CL找不到mspdb100.dll的问题

    https://www.cnblogs.com/dudu/archive/2011/05/21/2053104.html 更好解决方法是在命令行中运行vsvars32.bat: "C:\Pr ...

  3. 几个方便的基于es 的开源文档索引系统

    Apache Tika 比较有名的内容提取工具 FsCrawler 使用java 开发,内部使用了Tika Ambar nodejs,python应用开发,轻量,支持基于docker 的快速部署,同时 ...

  4. video标签在浏览器不能使用的问题 ?

    之前video标签是可以用的,但是压缩之后在移动端可以用,在pc浏览器不可以用? 怎么解决? 这样的写法会报错  说是缺乏source  但是你加上source也没有用 <video src=& ...

  5. SpringMVC通过注解在数据库中自动生成表

    在application-persistence.xml中的<property name="hibernate.hbm2ddl.auto" value="${hib ...

  6. 12.linux上Apache虚拟主机的建立和https协议网站建立

    一.Apache虚拟主机的建立   虚拟web主机 在同一台服务器上建立多个web站点,每个站点不独占用一台真正的服务器       1.建立dns解析 两个域名同一个ip               ...

  7. Centos7 中查找文件、目录、内容

    1.查找文件 find / -name ‘filename’ 2.查找目录 find / -name ‘path’ -type d 3.查找内容 find . | xargs grep -ri ‘co ...

  8. ArcGIS Python人门到精通目录基于ArcGIS10.2,100以上案例15章42个视频806分钟,51GIS网站上线

    ArcGIS Python人门到精通目录 闫老师 QQ:276529800 微信13108507190 1.  ArcGIS Python基础 1.1  ArcGIS为什么学习Python 1.2 A ...

  9. if ( ! defined('BASEPATH')) exit('No direct script access allowed')的作用

    在看源代码时,发现codeigniter框架的控制器中,总是加上这样一段话: if(!defined('BASEPATH'))exit('No direct script access allowed ...

  10. Java TreeSet,Collections使用

    一.创建TreeSet实例 public static void main(String[] args) { TreeSet set = new TreeSet(); set.add("C& ...