I have an array of objects as shown below, I want to display coresponding svg file of each object.icon, the first object is using ion-icons element and it works but how do I render svg file having only it's path/url? I want to avoid importing the svg files because there will be like 70 of them :)
[{
id: 1,
name: 'HTML',
icon: <ion-icon class='skill-icon' name='logo-html5' />,
},
{
id: 2,
name: 'CSS',
icon: './img.svg' />,
},]
import svgName from './img.svg'
[{
id: 1,
name: 'HTML',
icon: <ion-icon class='skill-icon' name='logo-html5' />,
},
{
id: 2,
name: 'CSS',
icon: svgName,
},]