Created
January 30, 2022 06:54
-
-
Save rickyalmeidadev/a571cd5446fadd499a8a657c23bd1c37 to your computer and use it in GitHub Desktop.
Configure routing progress bar in Next.js app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Router} from 'next/router' | |
import NProgress from 'nprogress' | |
NProgress.configure() | |
Router.events.on('routeChangeStart', () => NProgress.start()) | |
Router.events.on('routeChangeComplete', () => NProgress.done()) | |
Router.events.on('routeChangeError', () => NProgress.done()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment