Hide navbar collapse after click link, react-redux, reaction-bootstrap

I am starting to respond, so you need your help. I used the legible navbar bootstrap, had no idea how to make it collapse after linking to a mobile. The bootsrap collapseOnSelect native property does not work, or I did something wrong.

const  AppBar = () => (
  <Navbar collapseOnSelect>
    <Navbar.Header>
      <Navbar.Brand>
        <div className="logo-wrap"> 
          <Link to="define"> 
            <img height='50' src='./../assets/img/logo.png' className="logo"/> 
          </Link> 
        </div> 
      </Navbar.Brand>
      <Navbar.Toggle />
    </Navbar.Header>
    <Navbar.Collapse>
      <Nav>
        <LinkContainer to="define" className="nav-link"><NavItem eventKey={1}>Home</NavItem></LinkContainer>
        <LinkContainer to="about" className="nav-link"><NavItem eventKey={1}>About</NavItem></LinkContainer>
        <LinkContainer to="features" className="nav-link"><NavItem eventKey={1}>Features</NavItem></LinkContainer>
        <LinkContainer to="pricing" className="nav-link"><NavItem eventKey={1}>Pricing</NavItem></LinkContainer>
        <LinkContainer to="areaMap" className="nav-link"><NavItem eventKey={1}>Area Map</NavItem></LinkContainer>
      </Nav>
      <Nav pullRight>        
        <LinkContainer to="login" className="nav-link"><NavItem eventKey={2}>Log In</NavItem></LinkContainer>
        <LinkContainer to="registration"><NavItem eventKey={2}><Button className="sign-up">Sign Up</Button></NavItem></LinkContainer>
      </Nav>
    </Navbar.Collapse>
  </Navbar>
);


export default AppBar;
+4
source share

Source: https://habr.com/ru/post/1660204/


All Articles