79493278

Date: 2025-03-07 19:19:46
Score: 3
Natty:
Report link

In Next.js 13.5 and above the syntax has changed. The function properties object now comes second.

Before Next.js 13.5:

  router.push("<new_url>", undefined, { scroll: false })

Next.js 13.5 and above:

router.push("<new_url>", { scroll: false })

Next.js Official docs: https://nextjs.org/docs/app/api-reference/functions/use-router#disabling-scroll-to-top

Credit: https://stackoverflow.com/a/77370718/15903427

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ziroock