I was following along in the tutorial that Microsoft put out on how to convert your ReactNative project to TypeScript.
Everything worked great until I reached the point
I'am not sure if this is the best approach,the way I solved it is,
Create a file in the root folder containing images(Should be read by typescript) or any other folder as per your folder structure. Name it "your-name-here.d.ts" (d.ts should be the extension.Its used by typescript engine)
declare module '*.jpg' {
import { ImageSourcePropType } from 'react-native';
const value: ImageSourcePropType;
export default value;
}
ImageSourcePropType is the type expected by the source argument in Image
Now where ever an image is used can be used as
import SampleIcon from '../images/sample-image.jpg';