So I have the following:
// Build the component HTML.
return (
<dl className={ classes }>
{items.map((item, index) =>
{ item.type === 'dd' ?
<dd key={ index } index={ index }>{ item.text }</dd>
:
<dt className="search-result__description-list__description" key={ index } index={ index }>{ item.text }</dt>
}
)}
</dl>
);
The problem: nothing is rendering. The data is present in items. When I simply log the content without the if-else statement it also returns my data. However, when I use the if-else statement nothing shows up. No errors ether.
Any thoughts?