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

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

问题描述

我正在使用 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.

推荐答案

尝试在 location 之前添加 window(即 window.location).

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

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

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