I have started to learn Reactjs. I am trying to build a multiple page webapp and. As you can see from my code, there are a navbar and switch statement. The last line of the switch tag is the not found page and on that page I want that none of the navbar to be displayed. I could not find a way to make it happen.
In the simple way how to disable navbar in 404 error page?
function App() {
return (
<BrowserRouter>
<>
<div className="container">
<Navbar />
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/about" component={About} />
<Route exact path="/contact" component={Contact} />
<Route component={Pagenotfound} />
</Switch>
</div>
</>
</BrowserRouter>
);
}
export default App;