Exactly what I want is isActive which is in the NavLink function in the React Router Dom. However, I want to render SVG conditionally. Do you have any other solution? Thank you.
<NavLink
to="/"
style={({ isActive }) => (isActive ? activeStyle : undefined)}
>
Home
<NavLine className="active-line" />
</NavLink>
<NavLink
to="/asd"
style={({ isActive }) => (isActive ? activeStyle : undefined)}
>
Work
<NavLine className="active-line" />
</NavLink>
<NavLink
to="/dsa"
style={({ isActive }) => (isActive ? activeStyle : undefined)}
>
About
<NavLine className="active-line" />
</NavLink>
</div>```