()
| 136 | * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/pages/api-reference/functions/use-router) |
| 137 | */ |
| 138 | export function useRouter(): NextRouter { |
| 139 | const router = React.useContext(RouterContext) |
| 140 | if (!router) { |
| 141 | throw new Error( |
| 142 | 'NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted' |
| 143 | ) |
| 144 | } |
| 145 | |
| 146 | return router |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * Create a router and assign it as the singleton instance. |
no outgoing calls
no test coverage detected