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 ...
随机推荐
- PPP
名称 chat–调制解调器的自动对话脚本 命令格式 chat [options] script 描述 Chat程序定义了一个计算机和调制解调器之间对话交流,其主要目的是用来在本地PPPD和远端PPPD ...
- 最长升序列 DP
class Solution: def lengthOfLIS(self,nums): if not nums:return 0 #边界处理 dp = [1 for _ in range(len(nu ...
- 2019暑期金华集训 Day6 计算几何
自闭集训 Day6 计算几何 内积 内积不等式: \[ (A,B)^2\le (A,A)(B,B) \] 其中\((A,B)\)表示\(A\cdot B\). (好像是废话?) 叉积 \[ A\tim ...
- jmeter之timer --笔记一
简介:测试过程中需要用到time进行造数据测试,需要各种年月日,或者未来时间,就像python中的time和datetime 1.jmeter中timer,使用—time()函数 1.1 timeSh ...
- fork()函数 图解
code #include<stdio.h> #include <getopt.h> #include<iostream> #include<string&g ...
- Android中显式意图和隐式意图的区别
1.显式意图 可以直接通过名称开启指定的目标组件: 通过构造方法Intent(Context packageContext,class<?>cls)来实现. button_1 = (But ...
- S标签和C标签
<s:if test="#attr.info.RLZT==1"> <a style="cursor:hand;" onclick=" ...
- 安装 PHP 镜像
安装 PHP 镜像 方法一.通过 Dockerfile 构建 创建Dockerfile 首先,创建目录php-fpm,用于存放后面的相关东西. runoob@runoob:~$ mkdir -p ~/ ...
- 第十七周助教工作总结——NWNU李泓毅
助教博客链接:https://www.cnblogs.com/NWNU-LHY/ 本次作业的要求:软件测试与ALPHA冲刺:https://www.cnblogs.com/nwnu-daizh/p/1 ...
- Unity3D 2D模拟经营游戏 洗车沙龙 完整源码
Car Wash Salon Game 描述洗车模板与几个迷你游戏相关的汽车清洁,洗涤和装饰. 简单但有趣的游戏和伟大的视觉效果. 此模板不包含在应用中! 自定义应用程序的示例,有些功能在本项目中不受 ...