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

How can I import a file with two different custom extensions?

$
0
0

I have case where two files with same name but different custom extensions, for example in react native i have :

  CompA.android.tsx  CompA.ios.tsx

and i want to import like this import CompA from './CompA' but i got error from typescript says: "Cannot find module './CompA' or its corresponding type declarations.".

I tried to add something in tsconfig, like this

"paths": { "*":["src/*","*.android.tsx","*.ios.tsx"],}, 

but did not work

So is there any configs i can add to make my case works?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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