Typescript image import
One of the ways to get rid of that error is by modifying d.ts file as follows:
declare module "*.png"
remove
{
const value: string;
export default value;
}
or alternatively you can do:
declare module "*.png" {
const value: any;
export default value;
}
Update
The best solution with type-checking is:
declare module "*.png" {
const value: any;
export = value;
}
For react-native
create global.d.ts
file on project root
folder and just add next lines there
declare module '*.png' {
const value: import('react-native').ImageSourcePropType;
export default value;
}