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

关于react-router报错 Hash history cannot PUSH the same path #125

Open
ckinmind opened this issue May 29, 2017 · 3 comments
Open

关于react-router报错 Hash history cannot PUSH the same path #125

ckinmind opened this issue May 29, 2017 · 3 comments

Comments

@ckinmind
Copy link
Owner

发现使用新版本的路由的时候,点击同一个路由会有如下警告

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

参考资料:Warning: You cannot PUSH the same path using hash history

@JustinYi922
Copy link

I have the same problem, too。Have you solved it?

@ckinmind
Copy link
Owner Author

ckinmind commented Jul 8, 2017

@JustinYi922 这个问题应该只在开发环境有,构建打包后应该就不会有这个警告了,我的参考资料中有解释:

The warning is there just to let you know that when you're using hash history, you can't actually PUSH the same path; the browser won't add anything to the history stack.
But you should only get this warning in development. If you generate your production build correctly (using NODE_ENV=production) you shouldn't see this warning in production.

@JustinYi922
Copy link

不好意思是我搞错了。我把pathName敲成path了。

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

No branches or pull requests

2 participants