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.