Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 670 Bytes

File metadata and controls

16 lines (10 loc) · 670 Bytes

Infinite Scroll & Infinite Query using React hooks and React-query

Example 1 using only React hooks

infinitescroll1.mp4

Example 2 using React-query

infinitescroll2.mp4
  1. Used axios JS library to create an API to fetch data.
  2. Used useRef React hook to track the intersection observer.
  3. Used callback function to if the user has scrolled to the last post in a page.
  4. More posts will be loaded as soon as the user has reached the last post in a page.

Try it out: https://usakethinfinitescroll.netlify.app/