React router automatically applies "active" className even to non exact links.
I only need it to give the NavLink the "active" class when the user is in /solutions/
But when the user is in /solutions/web_apps, it still gives the NavLink the "active" class.
Here's my nav:
<nav>
<div>
<NavLink to="/"></NavLink>
</div>
<ul>
<NavLink to="/about">about</NavLink>
<NavLink to="/promises">our promise</NavLink>
<NavLink to="/process">our process</NavLink>
<NavLink exact={true} to="/solutions">solutions</NavLink>
<NavLink to="/careers">careers</NavLink>
</ul>
<NavLink to="/letstalk">let's talk</NavLink>
</nav>
This is the link to /solutions/web_apps
<Link exact={true} to="/solutions/web_apps">
<h3>...</h3><p>...</p>
</Link>
Here are the Routes:
<Routes>
<Route exact={true} path="/" element={<Home />} />
<Route exact={true} path="/solutions" element={<Solutions />} />
<Route exact={true} path="/solutions/web_applications/" element={<WebApps />} />
...
</Routes>
How can I give the "active" className to NavLink only when I'm in /solutions/ and not when I'm in /solutions/web_apps or in any link inside /solutions/
Please don't recommend downgrading
Thanks in advance