i have a icons name array like this:
const iconArray = [
{
link: "/",
iconName: "MdHome",
iconSize: 28,
notiNumber: 5,
},
{
link: "/account",
iconName: "MdAccountCircle",
iconSize: 28,
notiNumber: 5,
},
{
link: "/menu",
iconName: "MdReorder",
iconSize: 28,
notiNumber: 5,
},
]
I want converting iconName to components name like this <MdHome size="28" />, <MdAccountCircle size="28" />, <MdReorder size="28" />
This is my code:
iconArray.map(icon => {
return <{icon.iconName} size={icon.iconSize} />
})
When run it will to error