I have a Card
component and a QuestionCard
component.
what I want to do is when a user uploads a post or asks a question, it shows the respective component. And this is my idea of doing it :
const CardList = ({cardList}) => {
return (
<div className="cardWrapper">
<div className="cardColumn">
{cardList.map((card)=>{
if(){
<Card />
} else{
<QuestionCard />
}
})}
</div>
but I don't know what to fill in the expression. Am I have the right idea? Or there are some other ways to do it?
Here is some reference how what it should look like: