AI Engineer - Learn how to integrate AI into software applications
Build the Finance Skills That Lead to Promotions, Not Just Certificates
Overview
Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This tutorial demonstrates two ways to implement infinite scrolling in React: a custom hook using Axios, useRef, useCallback, and Intersection Observer, and React Query’s useInfiniteQuery. It tests both implementations with paginated post data.
Syllabus
Intro
Welcome
Starter code and dependencies
Axios API setup
usePosts custom hook
Example 1 component
Post component and forwardRef
Applying useRef
Checking functionality
Intersection Observer and useCallback
Testing Infinite Scroll & Query
Example 2: React Query setup
Example 2 component
useInfiniteQuery
Update Example 2 with useInfiniteQuery
Testing Example 2 functionality
Taught by
Dave Gray