Below is a component for a List/<ul> where there is a <li> for each item in classesByName. Is there any way to decide between using the component <ClassItemAnchor /> and an alternative, say <ClassItemButton /> depending on code higher up (outside of <ClassList />)? Otherwise, I'd have to create a new <ul> component to have a different <li> component?
import ClassItemAnchor from "./ClassItemAnchor"
const ClassList = ({ classesByName, getChat, searchName }) => {
return (
<ul className="chat-list">
{classesByName.map((Class) => (
<ClassItemAnchor
key={Class.id}
Class={Class}
searchName={searchName}
getChat={getChat}
/>
))}
</ul>
)
}
export default ClassList
Thank you