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

Flow complains about untyped import

$
0
0

I'm starting out on a React Native project that uses react-native-geolocation-service to get the user's GPS location, but Flow is complaining that the library is untyped. The library has Typescript types, but doesn't seem to have Flow types, and VS Code gives me this error when I import the library.

Importing from an untyped module makes it any and is not safe! Did you mean to add // @flow to the top of react-native-geolocation-service? (untyped-import)Flow(LintError-untyped-import)

Can I convince Flow to stop complaining about this library, or should I switch to Typescript? I don't have any particular preference for Flow, it's just what react-native init set up for me.

I used this to create the project:

npx react-native init WarmerWalker

Then I added the library like this:

npm install react-native-geolocation-service

I import the library like this in my App.js:

import Geolocation from 'react-native-geolocation-service';

I tried adding the library to the untyped section in .flowconfig, but that didn't help. Neither did the ignore section.

The code seems to work, it's just making Flow complain.


Viewing all articles
Browse latest Browse all 6214

Trending Articles



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