Skip to content

Commit

Permalink
Improve error type for routeChangeError event
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Sep 20, 2020
1 parent 1c49b4b commit 1c3e920
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/next/next-server/lib/router/router.ts
Original file line number Diff line number Diff line change
@@ -247,11 +247,16 @@ export type NextRouter = BaseRouter &
| 'isFallback'
>

export type RouterEventError = {
[key: string]: any
cancelled: boolean
}

export type RouterHandlersMap = {
routeChangeStart: (url: string) => void
beforeHistoryChange: (url: string) => void
routeChangeComplete: (url: string) => void
routeChangeError: (err: any, url: string) => void
routeChangeError: (err: RouterEventError, url: string) => void
hashChangeStart: (url: string) => void
hashChangeComplete: (url: string) => void
}

0 comments on commit 1c3e920

Please sign in to comment.