title: × TypeError: Cannot read property 'pathname' of undefined
body: <p>I have the following problem trying to hide the header, footer and aside for my login page</p>
  <p>this is my code:</p>
  <pre><code>import React, { Component } from 'react';
  import Header from './components/Header';
  import Footer from './components/Footer';
  import { BrowserRouter as Router, Route } from 'react-router-dom';
  
  import Routes from './routes';
  
  
      export default class App extends Component {
        render(){
      
          return(
          &lt;div&gt;
          {this.location.pathname==='/Login' ? null:
          &lt;div&gt;
              &lt;Header/&gt;
              &lt;Routes /&gt;
              &lt;Footer /&gt;
          &lt;/div&gt;
          }
          &lt;/div&gt;
          )
        }
      }
  </code></pre>
  <p>I get this error message
  TypeError: Cannot read property 'pathname' of undefined</p>
  <p>How can I prevent my header, aside, footer from being shown on my login page?</p>
  <p>Helpe please.</p>