ARTICLE AD BOX
could someone help me dynamically define the source of an image in native React with expo?
because I send to my component this table:
const sidebarContent: SidebarItemData[] = [ { icon: "home.svg", alt: "Icône du tableau de bord", label: "Tableau de bord", uri: "DashboardHome" }, { icon: "cog-6-tooth.svg", alt: "Icône des paramètres", label: "Paramètres", uri: "DashboardSettings", bottom: true }, { icon: "arrow-left-start-on-rectangle.svg", alt: "Icône de déconnexion", label: "Déconnexion", uri: "Logout", bottom: true } ];and I put the path of the image in an image that is in my component sidebaritem but it doesn’t work because of the bundle, would someone have an idea please?
<SidebarItem key={`${item.uri}-${index}`} link={item.uri} src={`src/assets/${item.icon}`} alt={item.alt} label={item.label} className={index !== items.length - 1 ? "mb-4" : ""} classNameImg="w-6 h-6" isCollapsed={isCollapsed} /> <Image source={{ uri: src }}