This content originally appeared on DEV Community and was authored by Henok Tsegaye
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());
This content originally appeared on DEV Community and was authored by Henok Tsegaye
Henok Tsegaye | Sciencx (2021-09-04T16:16:53+00:00) Using nprogress with next-js to show page is loading. Retrieved from https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.