Home > Enterprise >  React - List icons with different param
React - List icons with different param

Time:04-02

I'm trying to use the map function but I can't get it right. I have a side-bar which I want to show some icons. Here is an example without the map.

    const SideBar = () => {

    return (
        <div className="fixed top-0 left-0 h-screen w-20 m-0 flex flex-col bg-gray-100 text-white shadow-lg">
            <SideBarIcon icon={<FaFire size="30" />} />
            <SideBarIcon icon={<FaPoo size="30" />} />
        </div>
    );
};

const SideBarIcon = ({ icon, text = "tooltip            
  • Related