Skip to content

usaketh/InfinityPages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/