I'm still quite new to Typescript and react and unfortunately don't understand what I'm doing wrong. I have a tab style nav with a NavDropdown. Unfortunately the dropdown is the only tab that does not get the active class when one of the dropdown items is selected. I have already seen that some people had this problem and could solve it somehow but I can't find a way to do it in my case. Can anyone help me?
Currently my nav looks like this:
<Nav variant="tabs">
<Nav.Item>
<Nav.Link
onClick={(e: React.MouseEvent<Element, MouseEvent>) => setTab(e, "today")}
href="#today"
>
today
</Nav.Link>
</Nav.Item>
<NavDropdown
title={activeTab === "month" ? dateFormat(dateStart!, "MMMM yyyy") : "month"}
id="month"
>
{months.map((m) => (
<NavDropdown.Item onClick={() => setMonth(m)} key={dateFormat(m, "MMMM yyyy")}>
{dateFormat(m, "MMMM yyyy")}
</NavDropdown.Item>
))}
</NavDropdown>