NextJS Link refresh page and router.push not changing page

Viewed 15

I have a problem with my setup, I have NextJS 12.2 and React 18.2. In my Layout component I have one <Link href="/"> and one <button type="button" onClick={() => router.push('/login')}>.

When I click on the link the entire page is refreshing instead of just the children layout. When I click on the button, nothing happened.

Someone already got this type of problem with Next routing system ?

Thanks

0 Answers
Related