V
V
Vadim Chorrny2020-10-30 10:34:51
React
Vadim Chorrny, 2020-10-30 10:34:51

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>
  );
}


Here's what happened:
5f9bc1064a7a1348779535.png
5f9bc113146b9032575267.png

It turned out that when you click on the burger menu, the Menu component opens on top of other components.
Problem: How to remove the scroll?
Or maybe I have problems with Routs?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question