Skip to content

Instantly share code, notes, and snippets.

@remy

remy/Layout.js Secret

Last active November 5, 2018 23:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Add the following to the top of your Layout.js componet
import NProgress from 'nprogress';
import router from 'next/router';
router.onRouteChangeStart = () => NProgress.start();
router.onRouteChangeComplete = () => NProgress.done();
router.onRouteChangeError = () => NProgress.done();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment