No restricted globals

Martin Nordström picture Martin Nordström · Jul 9, 2017 · Viewed 101.7k times · Source

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.

Answer

Chasen Bettinger picture Chasen Bettinger · Jul 9, 2017

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