没有受限的全局变量 [英] No restricted globals

查看:137
本文介绍了没有受限的全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用React和Redux开发一个Web应用程序,当我启动项目时,我得到了这一点:

I am using React and Redux to develop a webapp and when I started up my project I got this:

Line 13:  Unexpected use of 'location'  no-restricted-globals

Search for the keywords to learn more about each error.

我搜索了很多有关如何解决它的方法,但是找不到答案对我有帮助,所以我转向堆栈溢出。

I search a lot about how to resolve it, but none of the answers I found helped me, so I turned to Stack overflow.

有人知道如何解决此错误吗?感谢您能获得的所有帮助。

Does anyone know how to fix this error? I appreciate all the help I can get.

推荐答案

尝试在位置之前添加窗口 / code>(即 window.location )。

Try adding window before location (i.e. window.location).

这篇关于没有受限的全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆