usaketh / InfinityPages

Implemented Infinite scroll and query in React

Home Page:https://usakethinfinitescroll.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/

About

Implemented Infinite scroll and query in React

https://usakethinfinitescroll.netlify.app/


Languages

Language:JavaScript 77.2%Language:HTML 16.2%Language:CSS 6.6%