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

Unexpected use of 'location' no-restricted-globals #21

Open
Anddrew914 opened this issue Jun 27, 2017 · 3 comments
Open

Unexpected use of 'location' no-restricted-globals #21

Anddrew914 opened this issue Jun 27, 2017 · 3 comments

Comments

@Anddrew914
Copy link

Anddrew914 commented Jun 27, 2017

It seems using the location global is not allowed so when you use it to set variables in your socket.io configuration at
src/index.jsx, const socket = io(${location.protocol}//${location.hostname}:8090);
react simply won't load the page. I got around this by just typing in my protocol and hostname,
const socket = io(${window.location.protocol}//${window.location.hostname}:8090);
Not sure if this will have any bad side effects though.
Thanks for this awesome tutorial by the way!

@jturner11
Copy link

Awesome ! Thanks for posting

@phamngoctuong
Copy link

On the line above the line you get your error, past this:
//eslint-disable-line
Example:
if(confirm('Delete?')) {//eslint-disable-line
}

@iomihai
Copy link

iomihai commented Nov 15, 2019

For me this worked.
if(window.confirm('Delete?')) {
}

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

4 participants