I have the following App.js:
function App() {
return (
<div className="App">
<Header></Header>
<HomePage></HomePage>
</div>
);
}
Anyone accessing the website should see the homepage first by default.
I have a navigation menu with the following routing information:
<Router>
<Switch>
<Route path='/login' component={Authentication} />
</Switch>
</Router>
When I click on the login menu link, the authentication page loads, but I can also see the homepage below when scroll down in the browser. How do I load only the page referenced in the router?
SOLUTION:
Added the following route to the router
<Route exact path='/' component={Home} />