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
Took me a while to figure this one out. For some strange reason, when I use connect to decorate my component, <LinkContainer> stops marking links as active. If I remove the connect()(Header) call, <LinkContainer> works as expected.
importReactfrom'react'import{connect}from'react-redux'import{LinkContainer}from'react-router-bootstrap'import{Nav,Navbar,NavItem,}from'react-bootstrap'classHeaderextendsReact.Component{render(){return(<div><Navbar><Navbar.Collapse><NavpullLeft><LinkContainerto="/dashboard/registrations"><NavItem>
Registrations
</NavItem></LinkContainer><LinkContainerto="/dashboard/monitoring"><NavItem>
Monitoring
</NavItem></LinkContainer></Nav></Navbar.Collapse></Navbar></div>)}}exportdefaultHeader/*When using connect(), LinkContainer stops working andlinks are no longer marked as active when URL changes*/// export default connect()(Header)
Here's the behaviour I get when using connect:
The text was updated successfully, but these errors were encountered:
Took me a while to figure this one out. For some strange reason, when I use connect to decorate my component,
<LinkContainer>
stops marking links as active. If I remove theconnect()(Header)
call,<LinkContainer>
works as expected.Here's the behaviour I get when using connect:
The text was updated successfully, but these errors were encountered: