For example, in the next image, the menu selected was about, the address string shows it, but the menu tab is still showing home
I am a newbie with Bootstrap
The code is this:
import React, { useState } from 'react';
import { Nav, NavDropdown } from 'react-bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
export default function NavSample() {
const [key, setKey] = useState('home');
const handleSelect = (key) => {
setKey(key);
};
return (
<Nav variant="pills" activeKey="home" onSelect={handleSelect} defaultActiveKey="home">
<Nav.Item>
<Nav.Link eventKey="home" href="/home">
Home
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="about" href="/about" title="about">
About
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="contact" href="/contact">Contact</Nav.Link>
</Nav.Item>
<NavDropdown title="Pricing" id="nav-dropdown">
<NavDropdown.Item eventKey="Basic pricing" href="/pricing/basic pricing">Basic</NavDropdown.Item>
<NavDropdown.Item eventKey="Corporate Pricing" href="/pricing/corporate pricing">Corporates</NavDropdown.Item>
<NavDropdown.Divider />
<NavDropdown.Item eventKey="Enterprise Pricing" href="/pricing/enterprise pricing">Enterprise</NavDropdown.Item>
</NavDropdown>
</Nav>
);
}
What am I missing?
Rafael