I want to show svg files (I have bunch of svg images) but the thing I couldn\'t find the way to show. I tried to use Image and Use componen
you can do this using a simple way
const { getDefaultConfig } = require("metro-config");
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer")
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
}
};
})();
declare module "*.svg" {
import { SvgProps } from "react-native-svg";
const content: React.FC;
export default content;
}
Finally, This is a import mathod
import USER from "../../assets/icons/user.svg"
and, this is for jsx