Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering a Link as react router link loses props #1027

Open
joshiste opened this issue Sep 22, 2020 · 0 comments
Open

Rendering a Link as react router link loses props #1027

joshiste opened this issue Sep 22, 2020 · 0 comments

Comments

@joshiste
Copy link

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?

@joshiste joshiste changed the title Rendering a Link as react router link Rendering a Link as react router link loses props Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant