wafrat
  • Home
Subscribe

next.js

A collection of 2 posts
next.js

Fixing `NextRouter was not mounted` in Next.js

I wanted to programmatically change the route. So I looked up how to do it on the docs and found this: 'use client'; import { useRouter } from 'next/navigation'; export default function Page() { const router = useRouter(); return ( ); } Great. So I called useRouter() in my code, and
Jun 6, 2023 — 1 min read
next.js

Changing the port when running Next.js apps in dev mode

By default, running npm run dev will start the dev server on port 3000. The automatically generated README says so it self. However, I wanted to reserve that port for my node.js server which provides the API to my app. Googling "changing the port of Next.js" returns a
Jun 6, 2023
wafrat © 2025