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 ...
随机推荐
- 【Vue.js游戏机实战】- Vue.js实现大转盘抽奖总结
大家好!先上图看看本次案例的整体效果. 实现思路: Vue component实现大转盘组件,可以嵌套到任意要使用的页面. css3 transform控制大转盘抽奖过程的动画效果. 抽奖组件内使用钩 ...
- CSS显示模式
div和span标签 1.容器级的标签中可以嵌套其他所有的标签(div->一般用于配合CSS完成网页的基本布局.h.ul.ol.dl.li.dt.dd......),文本级的标签中只能嵌套文字/ ...
- qt access 数据库
#include <QCoreApplication> #include <QSqlDatabase> #include <QSqlQuery> #include ...
- 如何登陆Tomcat的控制台
当我们成功安装启动Tomcat服务后,在浏览器输入http://localhost:8080(8080是Tomcat的默认端口,可自行修改)回车 右上角可以看到三个控制台:Server Status. ...
- PHP的ini_set函数用法
PHP ini_set用来设置php.ini的值,在函数执行的时候生效,脚本结束后,设置失效.无需打开php.ini文件,就能修改配置,对于虚拟空间来说,很方便. 函数格式:string in ...
- heatmap.js 参数说明
blur:每个点都是两个圆组成的,分别为内圆和外圆:外圆越大,看起来这个点越模糊,内圆部分比较清晰:外圆的颜色比较固定且与内圆颜色不同,内圆的颜色由value确定:blur决定外圆与内圆的占比大小 ...
- JVM 类加载器的双亲委托机制
1.类加载器的层次结构 在双亲委托机制中,各个加载器按照父子关系形成了树形结构(逻辑意义),除了根加载器之外,其余的类加载器都有且只有一个父加载器. public class MyTest13 { p ...
- CMU Database Systems - Timestamp Ordering Concurrency Control
2PL是悲观锁,Pessimistic,这章讲乐观锁,Optimistic,单机的,非分布式的 Timestamp Ordering,以时间为序,这个是非常自然的想法,按每个transaction的时 ...
- GIS自定义地理处理工具--极值提取
GIS自定义地理处理工具--极值提取 关键词:最大值提取,最小值提取,极值提取,极小值提取,极大值提取 商务合作,科技咨询,版权转让:向日葵,135—4855__4328,xiexiaokui#qq. ...
- Java基础 case穿透 多个case执行同一段代码
JDK :OpenJDK-11 OS :CentOS 7.6.1810 IDE :Eclipse 2019‑03 typesetting :Markdown code ...