Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6295

Global navigator object not found with Tyepscript

$
0
0

I am trying to use react-native-geolocation-service with in a React Native app and to do so the documentation says that to get the user's current location the following code needs to be added (see https://github.com/FaridSafi/react-native-google-places-autocomplete#more-examples):

navigator.geolocation = require('react-native-geolocation-service');

I am using Typescript and I am getting that navigator cannot be found which makes sense to me. If I change the file from .tsx to .js it will recognize navigator. How can I fix this using Typescript?


Viewing all articles
Browse latest Browse all 6295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>