Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个报错怎么回事:Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack #20

Open
i1240121619 opened this issue May 11, 2018 · 6 comments

Comments

@i1240121619
Copy link

Warning: Hash history cannot PUSH the same path; a new entry will not be added to the history stack 这个报错怎么回事

@javaLuo
Copy link
Owner

javaLuo commented May 11, 2018

重复的点击同一个路由地址可能会出现这个提示
react-router会忽略重复的路由跳转

@i1240121619
Copy link
Author

那怎么屏蔽这个提示

@javaLuo
Copy link
Owner

javaLuo commented May 11, 2018

开发环境先无视吧。正式打包后就没了

这也可能是某个地方做了自动跳转,但是跳转的路径就是当前路径,所以history.push操作无效

@miroku-y
Copy link

miroku-y commented May 17, 2018

@i1240121619 如果你在开发环境也不想看到这个Warning,可以设置Link 的replace属性为true

@i1240121619
Copy link
Author

@yangdongMC 怎么设置

@miroku-y
Copy link

我的情况是横向有一些菜单,我一直点击某一个相同的菜单,就会出现warning,然后这样<Link to="xxx" replace={true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants