This was first installed as a NPM dependency then vendored in ab6baf8bf60853bb90a4fa57e1cf087a121cb325. It's caused some problems such as #882 and there may be better alternatives.
If a more complex imperative smooth scroll is needed, then there are many hook libraries having this functionality (example). Underneath they are typically using something like this, if need to scroll to element's ref:
Context
This was first installed as a NPM dependency then vendored in ab6baf8bf60853bb90a4fa57e1cf087a121cb325. It's caused some problems such as #882 and there may be better alternatives.
Potential alternatives
From @ivan-aksamentov in https://github.com/nextstrain/nextstrain.org/issues/882#issuecomment-2141711954:
For a proper smooth scrolling in modern browsers, I believe that
<div id="#foo" />
+<Link href="#foo"/>
(or<a href="#foo"/>
) + some global CSS:(moz, caniuse)
should do without any packages.
If a more complex imperative smooth scroll is needed, then there are many hook libraries having this functionality (example). Underneath they are typically using something like this, if need to scroll to element's ref:
or, if need to scroll to coordinates: