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

Nav active, activeHref, activeKey unknown props warning #2199

Closed
CoreyKaylor opened this Issue Sep 7, 2016 · 12 comments

Comments

Projects
None yet
9 participants
@CoreyKaylor

CoreyKaylor commented Sep 7, 2016

There are warnings still being produced from the Nav component passing props down to its DOM elements. I see others reported this issue in this thread and was resolved, but it appears like there may be some lingering items.

React 15.3.1
react-bootstrap 0.30.3

@taion

This comment has been minimized.

Show comment
Hide comment
@taion

taion Sep 7, 2016

Member

Nav shouldn't have any DOM elements as children. It should only hold NavItems. If you're putting your own DOM elements in there, you'll have to deal with these props yourself.

Member

taion commented Sep 7, 2016

Nav shouldn't have any DOM elements as children. It should only hold NavItems. If you're putting your own DOM elements in there, you'll have to deal with these props yourself.

@taion taion closed this Sep 7, 2016

@gravitycode

This comment has been minimized.

Show comment
Hide comment
@gravitycode

gravitycode Oct 7, 2016

I dont like the solution that Bootstrap propose. Can´t bootstrap see if any of their childs is the type expected (NavItem for example) before injecting the properties?

gravitycode commented Oct 7, 2016

I dont like the solution that Bootstrap propose. Can´t bootstrap see if any of their childs is the type expected (NavItem for example) before injecting the properties?

@ondy1985

This comment has been minimized.

Show comment
Hide comment
@ondy1985

ondy1985 Oct 14, 2016

At least, do not inject it to DOM elements, it's a pretty easy check...

ondy1985 commented Oct 14, 2016

At least, do not inject it to DOM elements, it's a pretty easy check...

@Yuripetusko

This comment has been minimized.

Show comment
Hide comment
@Yuripetusko

Yuripetusko Oct 25, 2016

Agree that bootstrap shouldn't add those attributes to any non-bootstrap children within Nav

Yuripetusko commented Oct 25, 2016

Agree that bootstrap shouldn't add those attributes to any non-bootstrap children within Nav

@jquense

This comment has been minimized.

Show comment
Hide comment
@jquense

jquense Oct 26, 2016

Member

the Nav component only supports NavItems as children or components that wrap NavItem. other components aren't valid so we aren't going to have special, error prone and infeasible, logic to sniff child types.

Member

jquense commented Oct 26, 2016

the Nav component only supports NavItems as children or components that wrap NavItem. other components aren't valid so we aren't going to have special, error prone and infeasible, logic to sniff child types.

@miguelmich

This comment has been minimized.

Show comment
Hide comment
@miguelmich

miguelmich Oct 26, 2016

So there is no way to extend the default bootstrap components? I can't understand why other elements aren't valid, wasn't one of the bootstrap purposes to be extensible?

miguelmich commented Oct 26, 2016

So there is no way to extend the default bootstrap components? I can't understand why other elements aren't valid, wasn't one of the bootstrap purposes to be extensible?

@taion

This comment has been minimized.

Show comment
Hide comment
@taion

taion Oct 26, 2016

Member

You can extend <NavItem> or put something else in there with equivalent semantics. Just don't put a DOM element there directly.

Member

taion commented Oct 26, 2016

You can extend <NavItem> or put something else in there with equivalent semantics. Just don't put a DOM element there directly.

@miguelmich

This comment has been minimized.

Show comment
Hide comment
@miguelmich

miguelmich Oct 26, 2016

Great thanks!

miguelmich commented Oct 26, 2016

Great thanks!

@Yuripetusko

This comment has been minimized.

Show comment
Hide comment
@Yuripetusko

Yuripetusko Oct 26, 2016

Thanks for explaining @taion

Yuripetusko commented Oct 26, 2016

Thanks for explaining @taion

@pengliheng

This comment has been minimized.

Show comment
Hide comment
@pengliheng

pengliheng Jul 2, 2017

Nav shouldn't have any DOM elements as children. It should only hold NavItems. If you're putting your own DOM elements in there, you'll have to deal with these props yourself.

omg,,,,it is the prefect way to solve my issue

pengliheng commented Jul 2, 2017

Nav shouldn't have any DOM elements as children. It should only hold NavItems. If you're putting your own DOM elements in there, you'll have to deal with these props yourself.

omg,,,,it is the prefect way to solve my issue

@loganb

This comment has been minimized.

Show comment
Hide comment
@loganb

loganb Sep 4, 2017

Hello,

I just encountered this warning in 0.31.2 when using the NavText element nested inside a Nav element. I'm relatively new to React, so I'd appreciate any suggestions you have on how I can isolate the issue.

loganb commented Sep 4, 2017

Hello,

I just encountered this warning in 0.31.2 when using the NavText element nested inside a Nav element. I'm relatively new to React, so I'd appreciate any suggestions you have on how I can isolate the issue.

@taion

This comment has been minimized.

Show comment
Hide comment
@taion

taion Sep 6, 2017

Member

@loganb <Navbar.Text> goes under <Navbar>, not <Nav>.

Member

taion commented Sep 6, 2017

@loganb <Navbar.Text> goes under <Navbar>, not <Nav>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment