v1.0.1
Improve hook
This release improves useInfiniteScroll with scroll compensation for reverse directions and new options for controlling auto-loading behavior.
Features
useInfiniteScroll— added scroll position compensation for thetopandleftdirections. When content is prepended (e.g. loading older messages in a chat), the hook keeps the scroll position steady so the viewport no longer jumps.useInfiniteScroll— added theimmediatelyoption (defaultfalse) that controls whether the hook keeps calling the callback while the content doesn't overflow the viewport. When disabled, the callback fires only on scroll, which is useful for chats or lists with a manual "load more" button where auto-filling isn't wanted.useInfiniteScroll— added thehasMoreoption (defaulttrue) that stops triggering the callback when set tofalse, so there's no need to guard against extra calls once all content is loaded.