title: NextJS: How can I use a loading component instead of nprogress?
body: <p>Is it possible to use a <code>&lt;Loading /&gt;</code> component in NextJS instead of nprogress? I'm thinking you would need to access some high level props like <code>pageProps</code> from the router events so you can toggle the loading state and then conditionally output a loading component but I don't see a way to do this... </p>
  
  <p>For example, </p>
  
  <pre><code>Router.events.on("routeChangeStart", (url, pageProps) =&gt; {
    pageProps.loading = true;
  });
  </code></pre>
  
  <p>and in the render</p>
  
  <pre><code>const { Component, pageProps } = this.props;
  
  return pageProps.loading ? &lt;Loading /&gt; : &lt;Page /&gt;;
  </code></pre>
  
  <p>But of course, <code>routeChangeStart</code> doesn't pass in pageProps.</p>