Open r1zyn opened 1 year ago
@r1zyn - Below works for me, hope it helps:
pages/__app.tsx
import NProgress from 'nprogress'; import Router from 'next/router'; import '../styles/globals.css';
Router.events.on('routeChangeStart', () => NProgress.start()); Router.events.on('routeChangeComplete', () => NProgress.done()); Router.events.on('routeChangeError', () => NProgress.done());
export default function MyApp({ Component, pageProps }) { return <Component {...pageProps} /> }
Trying to use nprogress with Next.js, but when I change page the bar doesn't appear. I've used nprogress many times before and it had always worked previously.
pages/__app.tsx
I also import the stylesheet in
globals.css
(using postcss-import with Tailwind CSS)