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

typescript in a js file?

$
0
0

I'm attempting to follow the react-native-iap documentation, but keep running into the issue of "Type Annotations can only be used in TypeScript files".

When I look at their example (https://github.com/dooboolab/react-native-iap/blob/master/IapExample/App.js) the file is still a js file, and they use the same type annotation that I've used in my project:

async (purchase: InAppPurchase | SubscriptionPurchase)

Any idea how they were able to use type annotation in their js file? Or am I too focused on the error message, and simply need to disable 'TypeScript and JavaScript Language Features'?


Viewing all articles
Browse latest Browse all 6213

Trending Articles



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