Skip to content

v1.0.1

Choose a tag to compare

@debabin debabin released this 27 Jun 07:08
· 117 commits to main since this release

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 the top and left directions. 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 the immediately option (default false) 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 the hasMore option (default true) that stops triggering the callback when set to false, so there's no need to guard against extra calls once all content is loaded.