-1
If you turn on, I started making an app and I needed a header menu for the transition, this would be a menu that is rendered on every page. That is why it was created and is ultimalized outside the . That’s why I need to upgrade (according to the documentation) the "Withrouter", but because it’s new in Act, I’m having problems understanding the old syntax (which is in the documentation) and I’m not being able to adapt to the new version.
How do I make my menu receive routing capability?
//Menu que precisa das rotas
export default function MenuBar() {
return(
<DropdownButton title={title} id="bg-nested-dropdown">
<Dropdown.Item as="button" eventKey="1">
Home
</Dropdown.Item>
<Dropdown.Item as="button" eventKey="2">
Sobre
</Dropdown.Item>
<Dropdown.Item as="button" eventKey="4">
Cadastro de Post
</Dropdown.Item>
<Dropdown.Divider />
</DropdownButton>
)};
//app.js do react
function App() {
return (
<div className="App">
<MenuBar></MenuBar>
<div className="container">
<Routes></Routes>
</div>
</div>
);
}
//API documentation https://reacttraining.com/react-router/web/api/withRouter