Answer the question
In order to leave comments, you need to log in
How to remove the scroll or how to use React Route correctly?
Hello!
How to properly use React Route.
I have components that should not change, and there is a button that lies in the Header, this button should open the Menu component.
Here is my code:
function App() {
return (
<BrowserRouter>
<div className="App">
<Switch>
<Route path="/menu" exact>
<Menu />
</Route>
</Switch>
<Header name='Vadim Chorrny' />
<Acces />
</div>
</BrowserRouter>
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question