I have working code and a little problem with the if statement in the map function here is code.
<main className="grid-b">
{offers.map((offers,index)=> {
if(offers.status==='pending')
return
<
<article>
<div className="text-b">
<h3>Post ID: {index + 1}</h3>
<p>Quantity (Kg): {offers.quantity}</p>
<p>Unit Price (Rs): {offers.value}</p>
<p>Expiry Date: {moment(offers.expiryDate).fromNow()}</p>
<p>Offer Gives: {moment(offers.offerCreatedAt).fromNow()}</p>
</div>
</article>
/>
})}
</main>
Now I want to check if the statement to render only when in map offers.status==='pending' if not, does not show anything. But this code does not work. How should I solve this issue?