Is it possible to add props to a component represented by an object?
children: [
{
id: '1',
isActive: false,
label: 'Home',
component: <ReportsIcon height={30} width={30} />,
},
{
id: '2',
isActive: true,
label: 'Dashboard',
component: <SettingsIcon height={30} width={30} />,
},
].map((item) => (
<MenuLink key={item.id} isActive={false} label={item.label}>
<a href={`#`}>
{item.component // ADD PROPS HERE //}
{item.label}
</a>
</MenuLink>
)),
Via Active questions tagged javascript - Stack Overflow https://ift.tt/ZO6UirW
Comments
Post a Comment