this.props.location returns currently opened url.
, так что вы можете проверить текущий URL и условно отобразить NavBar. если текущий URL-адрес равен тем URL-адресам, в которых вы не хотите показывать navbar, возвращайте null, иначе возвращайте navbar
<BrowserRouter>
<div>
{
((this.props.history.location === '/') || (this.props.location === '/Aboutus')
|| (this.props.history.location === '/Contactus') ||
(this.props.history.location === '/selecttemplate') ||
(this.props.history.location === '/result1')) ? null : <Navbar />
}
<Switch>
.
.
.