Update Params without Scrolling To Top in Next.js

When changing query params, you can use a shallow push to avoid the page scrolling to the top.

router.push({ query: { mode: newTab } }, undefined, { shallow: true });