Using nprogress with next-js to show page is loading

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 NProgr…


This content originally appeared on DEV Community and was authored by Henok Tsegaye

using next js with nprogress

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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Using nprogress with next-js to show page is loading." Henok Tsegaye | Sciencx - Saturday September 4, 2021, https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/
HARVARD
Henok Tsegaye | Sciencx Saturday September 4, 2021 » Using nprogress with next-js to show page is loading., viewed ,<https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/>
VANCOUVER
Henok Tsegaye | Sciencx - » Using nprogress with next-js to show page is loading. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/
CHICAGO
" » Using nprogress with next-js to show page is loading." Henok Tsegaye | Sciencx - Accessed . https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/
IEEE
" » Using nprogress with next-js to show page is loading." Henok Tsegaye | Sciencx [Online]. Available: https://www.scien.cx/2021/09/04/using-nprogress-with-next-js-to-show-page-is-loading/. [Accessed: ]
rf:citation
» Using nprogress with next-js to show page is loading | Henok Tsegaye | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.