using next js with nprogress
using next js should be one of the most awesome thing ever, i have used it and i loved it.
so nprogress had support for next js and other js frameworks
here is how it works.
put this in _app.js
.
import NProgress from 'nprogress';
import Router from 'next/router';
import 'nprogress/nprogress.css';
NProgress.configure({
minimum: 0.3,
easing: 'ease',
speed: 800,
showSpinner: false,
});
Router.events.on('routeChangeStart', () => NProgress.start());
Router.events.on('routeChangeComplete', () => NProgress.done());
Router.events.on('routeChangeError', () => NProgress.done());
Top comments (2)
how to use to next js 13 ?
It should also work for next 13