redux-voting-client
redux-voting-client copied to clipboard
Unexpected use of 'location' no-restricted-globals
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!
Awesome ! Thanks for posting
On the line above the line you get your error, past this: //eslint-disable-line Example: if(confirm('Delete?')) {//eslint-disable-line }
For me this worked. if(window.confirm('Delete?')) { }