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

React Native Typescript Not Recognizing .d.ts Files

$
0
0

I am writing a reac-native app, created from the typescript template. When I create a file for types, lets call it fragmentTypes.d.ts and try to import it using the standard import {MyType} from './fragmentTypes' I get an error saying

error: Error: Unable to resolve module `./fragmentTypes` from `src\Pages\Login\Fragments\index.ts`:None of these files exist:  * src\Pages\Login\Fragments\fragmentTypes(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)  * src\Pages\Login\Fragments\fragmentTypes\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)

It works when I try and import fragmentTypes.d, but obviously that isn't the best solution. How do I change what file types its looking for and add d.ts?


Viewing all articles
Browse latest Browse all 6213

Trending Articles



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