i am trying to import every icon using 'react-icons' package. Its importing fine but when i am trying to use them as a component in my loop it wont display anything.
import * as fa from "react-icons/fa";
{Object.values(fa).forEach((value) => {
<value/>
})}
I didn't wanted to copy the majority of the code as it has nothing to do, just keep in mind that i am using the object function in return.
That's expected, you're not returning anything, you're just iterating over an array of objects.
For such rendering manipulation just use
map
, and it's preferable to Capitalize the first letter of the component, and adding a key when iterating to help in the behind the scenes process :