Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 511 Bytes

next-router-not-mounted.md

File metadata and controls

13 lines (7 loc) · 511 Bytes

NextRouter was not mounted

Why This Error Occurred

A component used useRouter outside a Next.js application, or was rendered outside a Next.js application. This can happen when doing unit testing on components that use the useRouter hook as they are not configured with Next.js' contexts.

Possible Ways to Fix It

If used in a test, mock out the router by mocking the next/router's useRouter() hook.

Useful Links