When I happily implemented smooth-scroll using Svelte, I discovered that it can actually be achieved with just one line of CSS:
html {
scroll-behavior: smooth;
}
Apart from concerns about browser support, this completely eliminates the hassle of developers importing libraries or implementing it themselves.
Perfectly achieving smooth-scroll
without the need to modify hashchange and state change behaviors. I will write an article someday on how to achieve smooth-scroll without using CSS.