use-location-state
use-location-state copied to clipboard
Keep scroll position on update in Next.js
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!