redux-voting-client icon indicating copy to clipboard operation
redux-voting-client copied to clipboard

Unexpected use of 'location' no-restricted-globals

Open Anddrew914 opened this issue 7 years ago • 3 comments

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!

Anddrew914 avatar Jun 27 '17 00:06 Anddrew914

Awesome ! Thanks for posting

jturner11 avatar Jun 19 '18 12:06 jturner11

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

phamngoctuong avatar Apr 17 '19 09:04 phamngoctuong

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

iomihai avatar Nov 15 '19 12:11 iomihai