Rendering a Link as react router link loses props
joshiste opened this issue · 0 comments
joshiste commented
currently I'm using this approach to render a react-router-dom NavLink with rebass:
import {Link} from "rebass";
import {NavLink} from "react-router-dom";
export const NavbarLink ({children,...props }) => {
return (
<Link
{...props}
as={NavLink}
variant="nav"
>
{children}
</Link>
);
};
The problem is, that the exact
prop is not forwarded to the NavLink. As the `shouldForwardProp' function used by rebass only forwards hmtl attributes. Is there a workaround to this?