I want to store an MUI component, more specifically an MUI icon, in a variable, something like
item.icon = <FilterListIcon />;
And later, in other components, doing:
<ListItem button key={item.text} onClick={item.onClick}>
{item.icon &&
{
<ListItemIcon>{item.icon}</ListItemIcon>
}}
<ListItemText primary={item.text} />
</ListItem>
But, when I do so, the browser page gets empty, everything disappears
I'm doing the same with the name and other stuff, but it works:
item.text = 'Item 1 for spv';
item.onClick = () => navigate('/showPlainVideos');
How could I fix this?