I am trying to get to grips with React-Bootstrap and was attempting to replicate a navbar similar to that in their documentation, but my Form component is not displaying as shown in the documentation with the inline attribute. My button appears under my form, not sure what the issue is.
Here is the code for my component:
import Navbar from 'react-bootstrap/Navbar';
import Nav from 'react-bootstrap/Nav';
import Form from 'react-bootstrap/Form';
import FormControl from 'react-bootstrap/FormControl';
import Button from 'react-bootstrap/Button';
const MyNav = () => (
<Navbar bg='dark' variant='dark' expand='sm'>
<Navbar.Brand href='/'>Maths Tips</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="mr-auto">
<Nav.Link href='/'>Home</Nav.Link>
<Nav.Link href='/rules'>Rules</Nav.Link>
</Nav>
<Form inline>
<FormControl type='text' placeholder='Search' className='mr-sm-2' />
<Button type='submit'>Search</Button>
</Form>
</Navbar.Collapse>
</Navbar>
);
export default MyNav;
I have bootstrap imported into my App.scss file, which is then imported into my App.js file where the MyNav component is being rendered.
These are the package versions I'm using that might be relevant:
"bootstrap": "^5.0.1"
"react": "^17.0.2"
"react-bootstrap": "^1.6.0"