5

Using nprogress with next-js to show page is loading

 3 years ago
source link: https://dev.to/henoktsegaye/using-nprogress-with-next-js-to-show-page-is-loading-2e34
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for Using nprogress with next-js to show page is loading

Using nprogress with next-js to show page is loading

Sep 4

・1 min read

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());


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK