You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to pass as props to <CNavLink> inside a <CNavItem>, which was previously possible. This makes it impossible to use the Router's <Link> (e.g. <NavLink> from react-router-dom) component within <CNav>.
The as prop that was previously passed to <CNavLink> as rest is now used in the part that wraps (previously li). This change has caused the as prop to no longer function correctly when passing <Link>.
Proposed Solution
One possible solution is to add a navLinkAs prop, as shown below.
Environment
ArchLinux
(likely occurs with other OS as well)Vivaldi (Chromium-based) 6.9.3447.44
(likely occurs with other browsers)Source Code
coreui-react/packages/coreui-react/src/components/nav/CNavItem.tsx
Lines 18 to 33 in 2652a91
Description
It is not possible to pass
as
props to<CNavLink>
inside a<CNavItem>
, which was previously possible. This makes it impossible to use the Router's<Link>
(e.g.<NavLink>
fromreact-router-dom
) component within<CNav>
.Problem Explanation
This issue likely occurred due to the following changes:
2652a91?diff=split&w=0#diff-1e4fdbb5559a22bedb4e23de9ec5e8452d240aef08945cc08c18168f68a051d6L7-R33
The
as
prop that was previously passed to<CNavLink>
asrest
is now used in the part that wraps (previouslyli
). This change has caused theas
prop to no longer function correctly when passing<Link>
.Proposed Solution
One possible solution is to add a
navLinkAs
prop, as shown below.If necessary, I can create a PR with the above changes.
The text was updated successfully, but these errors were encountered: