Hook for smoothly scrolling to an element, identified by its id, class name, or a ref.
Since lazy-loaded content elsewhere on the page can shift the target's position after the
initial scroll starts, it watches the page for a short window afterwards and corrects the
scroll position if it moves.
A scrollTo(target, options) function which returns true if a matching element
was found and the scroll started, or false if no matching element exists, so callers can
fall back to something else (e.g. navigating elsewhere).
Hook for smoothly scrolling to an element, identified by its id, class name, or a ref. Since lazy-loaded content elsewhere on the page can shift the target's position after the initial scroll starts, it watches the page for a short window afterwards and corrects the scroll position if it moves.