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

Usage of types and interface without importing

$
0
0

I recently moved to typescript to write React Native applications and one thing I have noted is that I can use types without importing/exporting them. I have placed all the definition files under the @types folder.

Is it the correct way of doing it without exporting and importing types?

If I import an external type from node_modules/ (say ViewStyle from react-native) and use it in my interface, it says "Cannot find the name" in VScode and I have to export the interface and import it where it's required to solve this.

I am trying to use the least possible amount of imports.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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