title: How to hide NavBar in login & signup?
body: <p>I've been searching for a while about how to hide the navigate in login and signup using react-router-dom or whatever, all what I've found is a complicated codes and very old posts and they doesn't help me. All I ask if it's possible to hide the navbar only for login &amp; signup pages or should I put the navbar in each component I don't think that makes sense.</p>
  
  <p>I have tried to do as the same of this post <a href="https://stackoverflow.com/questions/46342711/how-to-hide-navbar-in-login-or-signup-page-reactn-router">How to hide navbar in login or signup page reactn router</a> but I'm getting undefined result for <code>this.props.location</code> </p>
  
  <pre><code>import React, {Component} from 'react';
  import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
  
  
  import Login from './login';
  import signup from './signup';
  import Home from './dashboard/index';
  import NavBar from './navbar';
  
  class App extends Component {
      constructor(props){
          super(props);
          this.state = {
              isNavbarHidden: false
          };
      }
      render() {
          return (
              &lt;div&gt;
                  &lt;NavBar/&gt;
                  &lt;Router&gt;
                          &lt;Switch&gt;
                              &lt;Route path="/login" component={Login} /&gt;
                              &lt;Route path="/signup" component={signup} /&gt;
                              &lt;Route path="/home" component={Home} /&gt;
                          &lt;/Switch&gt;
                  &lt;/Router&gt;
              &lt;/div&gt;
          )
      }
  }
  export default App;
  </code></pre>