{announcements.map( ( v, i ) =>
{
const type = v.taxonomy && v.taxonomy.toUpperCase();
if ( props.filter && props.filter.announcement.toUpperCase() != type )
{
return i < 1
&& <p key={i} className="text-xs">No announcements</p>;
}
}
}
Say props.filter.announcement == "TRADE" and type has "TRADE, INVEST, EFT,....." I want to check if the filter props exist and filter.announcement does not have any type then return no annoucement para. But right now say I'm filtering "TRADE" category, when the filter matches the type, it gives a different return. Whereas it also returns this not matching function as during the map loop the posts having category other than TRADE match the condition so I'm getting both TRADE match return as well as no announcement return. How can I make this condition work?