Source Code: [ Ссылка ]
Article: [ Ссылка ]
In this video we'll implement infinite scrolling with modern React Hooks. We're going to call a REST api (but you could use GraphQL too) to fetch a list of JSON objects, then we'll print these out on the screen.
When the user scrolls towards the end of the page, a function will trigger to fetch more records from the API, and will continue to display more results on the same page until the API has no more records to send to the client.
Infinite Scrolling requires the use of useRef, useEffect, and the JavaScript IntersectionObserver API.
Ещё видео!