getUserLocationHandler = () => { //console.log('Button pressed'); navigator.geolocation.getCurrentPosition( position => { console.log(position); }, err => { console.log(err); }, { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 } ); } Following is the error - [eslint] 'navigator' is not defined. (no-undef)