a function call and instead saw an expression, what I did wrong?
<li className="nav-item categories">
{sections.map((sc, secIdx) => {
sc.categories.length > 0 && (
<ul className="navbar-nav d-none mt-0" data-category={secIdx}>
<li
className="nav-item category"
data-category={secIdx}
onClick={handleBackNavigation}
>
BACK
</li>
{sc.categories.map((ctg, ctgIdx) => {
ctg.sub_categories.length > 0 && (
<li className="nav-item category" data-category={secIdx}>
<Link
to="#"
className="nav-link font-weight-bold"
data-curr-section={secIdx}
data-subcategory-id="0"
onClick={e => showSections(e, true)}
>
{ctg.name}
</Link>
</li>
)
})}
</ul>
)
})}
</li>
map function doesn't return anything
so I have to use a fragment ?
Обсуждают сегодня