react-router-bootstrap: LinkContainer triggers "unknown prop" warning in React.js 15.2
LinkContainer setting active prop in child anchor tag causes React.js 15.2 to complain.
warning.js:44Warning: Unknown prop `active` on <a> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
in a (created by AppView)
in li (created by AppView)
in ul (created by AppView)
in nav (created by AppView)
in div (created by AppView)
in AppView (created by RouterContext)
in RouterContext (created by Router)
in Router
See react-unknown-prop mentioned in the warning for more details.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 23 (6 by maintainers)
There is no
LinkContainerin that element stack you’ve posted.I think you’re misunderstanding what that warning means, and what the point of
<LinkContainer>is.<LinkContainer>is exactly intended to inject downonClick,href, andactiveprops. It’s the responsibility of the contained component (as is the case with React-Bootstrap components) to strip out theactiveprop and render the relevant active state.Also occurs with Navbar.Link (used in order to link to an external URL). I’ve worked around it instead by wiring up a NavItem to an onClick event that redirects. Are there any other suggestions?