title: Get URL pathname in nextjs
body: <p>I have a signin page and layout component.Layout component has header.I don't want to show header in signin .and for that I want to get url pathname.based on pathname show the header .</p>
  
  <pre><code>import * as constlocalStorage from '../helpers/localstorage';
  import Router from 'next/router';
  
  export default class MyApp extends App {
      componentDidMount(){
          if(constlocalStorage.getLocalStorage()){
              Router.push({pathname:'/app'});
          } else{
              Router.push({pathname:'/signin'});
          }
  
      }
  
      render() {
          const { Component, pageProps } = this.props
          return (
  //I want here pathname for checking weather to show header or not
                  &lt;Layout&gt;
                      &lt;Component {...pageProps} /&gt;
                  &lt;/Layout&gt;
          )
      }
  }
  </code></pre>
  
  <p>please help</p>