I have a following code, with such imports:
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from 'react-router-dom'
import { Comics } from './Comics';
import { Books } from './Books';
import { Projects } from './Projects';
import { Navigation } from './Navigation';
function App() {
return (
<Router>
<div className="App">
<Navigation loggedInUser={loggedInUser} />
<Route path="/" exact component={Home} />
<Switch>
<Route path= "/comics" component={Comics} />
<Route path="/books" component={Books}/>
<Route path="/projects" component={Projects} />
</Switch>
</div>
</Router>
)
}
How to hide navigation when I am on "/" route? I could render Navigation on each route but I don't think this is a good idea performance wise?