use-location-state icon indicating copy to clipboard operation
use-location-state copied to clipboard

Keep scroll position on update in Next.js

Open JuroUhlar opened this issue 1 year ago • 0 comments

Hi, updating the state in NextJS scrolls makes the page scroll to the top. That's usually not what you want, and I think it can be easily prevented by using router[method](newUrl, undefined, { scroll: false }) (or making the behavior configurable).

More details regarding the Next.js behavior here: https://github.com/vercel/next.js/pull/20606https://github.com/vercel/next.js/pull/20606

Thanks a lot for making this package!

JuroUhlar avatar Oct 28 '23 14:10 JuroUhlar