Currently, I am working on a menu that consists of a list of MenuItem
components:
<MenuItem>A</MenuItem>
<MenuItem>B</MenuItem>
<MenuItem>C</MenuItem>
I am looking to customize the component to be visible only when a boolean (such as `isLoggedIn`) is true. Is there a way to achieve this without manually adding a condition to each of the menu items, especially since I have a large number of them?
const PrivateMenuItem = styled.MenuItem` \\what to write here `;
<PrivateMenuItem>A</PrivateMenuItem>
<PrivateMenuItem>B</PrivateMenuItem>
<PrivateMenuItem>C</PrivateMenuItem>