Here is my super basic react component that renders a navbar using react-bootstrap
:
import React, { Component } from "react";
import { Nav, NavItem, Navbar, Grid } from "react-bootstrap";
import { LinkContainer } from "react-router-bootstrap";
export default function Header() {
return (
<Navbar collapseOnSelect>
<Navbar.Header className="mr-auto">
<Navbar.Brand>
<LinkContainer to="/">
<a>User Management via Redis</a>
</LinkContainer>
</Navbar.Brand>
<Navbar.Toggle />
</Navbar.Header>
<Nav pullRight>
<LinkContainer exact to="/">
<NavItem>Search</NavItem>
</LinkContainer>
<LinkContainer to="/users">
<NavItem>All Users</NavItem>
</LinkContainer>
</Nav>
</Navbar>
);
}
I want my navigation links to be floated right, but unfortunately following the react-bootstrap docs and adding pullRight
prop to the Nav element makes the right floated nav overflow.
I can easily solve the problem by giving the right floated nav an ID and a margin-left of -30px, but I'd rather not since the actual docs show nicely working examples. How can I get the Nav with the pullRight prop to nicely position itself in the NavBar?