现象

在用`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. RookeyFrame 字典 新增和绑定

    原文:https://www.cnblogs.com/rookey/p/10856657.html 注意: 数据字典 -> 新增 把“是否生效”勾上 是否生效都要勾上哦 !!! 应该自动勾上才对 ...

  2. codevs 2058 括号序列

    2058 括号序列  时间限制: 2 s  空间限制: 128000 KB  题目等级 : 白银 Silver 题解       题目描述 Description 定义满足以下规则字符串为规则序列,否 ...

  3. CODE FESTIVAL 2016 Final 题解

    传送门 \(A\) 什么玩意儿-- const char c[]={"snuke"}; char s[15];int n,m; int main(){ scanf("%d ...

  4. Chrome远程调试之WebSocket

    var ws = new WebSocket('ws://localhost:9222/devtools/page/3c5c05fa-80b7-4cfe-8d1d-ebe79a7a5730');ws. ...

  5. 微信小程序“一劳永逸”的接口封装

    前言 最近都在研究小程序了,我可以的! 需求 之前都是用vue来开发项目的,接口模块我特意封装了一下.感觉也可以记录一下 小程序的接口虽说简单,但是重复调用那么多,显得不专业(一本正经的胡说八道) 还 ...

  6. mysql8数据库连接kettle

    1.将kettle连接mysql的包放入lib文件目录 2.修改data-integration\simple-jndi路径下的jdbc.properties配置文件,加上如下内容(kettle为数据 ...

  7. html中a标签的常见用法

    html中a标签的常见用法 一.总结 一句话总结: a.页面跳转 b.使用锚点定位 c.下载文件 二.html中<a>标签的用法 转自或参考:html中<a>标签的用法http ...

  8. colormap是MATLAB里面用来设定和获取当前色图的函数。

    下面将举例.描述MATLAB内建的色图.用户除了可以编程指定MATLAB内建的色图,还可以使用Plot Tools图形用具界面的Figure Properties面板中的Colormap菜单来选择一种 ...

  9. Ubuntu 命令行连接WiFi

    查看是否已经正确安装无线网卡 iwconfig .启动无线网卡, 如果网卡是wlan0 # 方式1 ifconfig wlan0 up # 或者方式2 ip link set wlan0 up .扫描 ...

  10. R scholar和rentrez | NCBI和Google scholar文献数据挖掘

    主要会用到两个R包: rentrez: 'Entrez' in Rscholar: Analyse Citation Data from Google Scholar RISmed 包可以查询 Pub ...