{"repo":"ankeetmaini/react-infinite-scroll-component","free":true,"listed":false,"github":"https://github.com/ankeetmaini/react-infinite-scroll-component","clone":"git clone https://github.com/ankeetmaini/react-infinite-scroll-component.git","description":"An awesome Infinite Scroll component in react.","language":"TypeScript","stars":3091,"topics":["react","infinite-scroll","infinite-lists","component","npm-package"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"react-infinite-scroll-component Infinite scroll for React. Zero runtime dependencies, IntersectionObserver-based, TypeScript-first. 4 kB gzipped. Works with window scroll, fixed-height containers, and custom scrollable parents. Pull-to-refresh and inverse (chat) scroll included. React 17, 18, and 19 compatible. Install Two APIs API When to use ------------------------------------------------------- -------------------------------------------------------------------------- InfiniteScroll component Most cases, handles loader, endMessage, pull-to-refresh, inverse scroll UI useInfiniteScroll hook Custom UI, you own the markup, the hook manages the observer --- InfiniteScroll component Basic usage (TypeScript) Scroll inside a fixed-height container Pass a ref value directly instead of a string id: Inverse scroll (chat / messaging UIs) Pull-to-refresh --- useInfiniteScroll hook For when you need full control over your markup. Place the sentinelRef div at the end of your list, the hook fires next() when it enters the viewport. --- Framework recipes Next.js App Router InfiniteScroll is a client component. Fetch initial data in a Server Component, pass it down. With TanStack Query With SWR --- Three scroll modes Mode How to use Use case ---------------------------- --------------------------------------- ------------------------------------- Window scroll Omit height and scrollableTarget Social feeds, blogs, product listings Fixed-height container Pass height prop Embedded lists, side","default_branch":null,"files":null,"tree":[],"storefront":"/r/ankeetmaini","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ankeetmaini/react-infinite-scroll-component/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}