ElectronHacked / nextjs-typescript-antd

Yoman Generator for https://github.com/ElectronHacked/nextjs-typescript-antd! It's based on NextJS, TypeScript, Antd
https://github.com/ElectronHacked/nextjs-typescript-antd
MIT License
30 stars 5 forks source link

Property 'onRouteChangeStart' does not exist on type 'SingletonRouter'. #4

Open jairorudas opened 4 years ago

jairorudas commented 4 years ago

Hi!

I cloned the repository, after install the dependencies throw this error. Some idea to fix?

Failed to compile
ERROR in /Users/jairorudas/Projetos/honguer/honguer-pwa-app/components/global/customNProgress/index.tsx(8,8):
8:8 Property 'onRouteChangeStart' does not exist on type 'SingletonRouter'.
     6 | NProgress.configure({ showSpinner: false });
     7 | 
  >  8 | Router.onRouteChangeStart = _ => {
       |        ^
     9 |   NProgress.start();
    10 | };
    11 | 
BradyEdgar94 commented 3 years ago

Any solutions?

SemajDraw commented 3 years ago

Although examples with this syntax still exist in the Vercel GitHub the docs have been updated to the following syntax.

router.events.on('routeChangeStart', handleRouteChange)