Hi I created a template in React that use a Object to fill it. But the SVG is not rendered and I don't know why. The path of the folder and de svg image is all correct.
Here is the object:
export const homeObjOne = {
id: 'about',
lightBg: false,
lightText: true,
lightTextDesc: true,
topLine: 'Gym Application',
headLine: 'For Our Fitness Lovers',
description: 'Lorem',
buttonLabel: 'Get started',
imgStart: false,
img: require('../../images/svg-1.svg'),
alt: 'Growth',
dark: true,
primary: true,
darkText: false
};
And here is the template where de object is passed:
const InfoSection = ({
lightBg,
id,
imgStart,
topLine,
lightText,
headline,
darkText,
description,
buttonLabel,
img,
alt,
primary,
dark,
dark2
}) => {
return (
<Img src={img} alt={alt} />
);
};
export default InfoSection;
I have only writed the essential code because is more easy to read and answer the question. The app doesn't send any error about htat the path or de svg-1.svg doesn't exist, and all the other components of the object are rendered well so I don't know what's going wrong.
If anyone could help me, please let me knonw. Thanks!