Infinite Scroll Component with React Query

Опубликовано: 02 Октябрь 2022
на канале: Radzion Dev
2,210
23

In this tutorial video, we will be creating an infinite scroll component using React Query. This includes using the `useInfiniteQuery` hook to query a paginated API, and the `queryItems` function to fake an API. We'll also discuss the use of `getNextPageParam` to get the page parameter for the query function, the data format coming from the hook, converting the data to a plain list using `usePaginatedResultItems`, and the creation of a `PaginatedView` component to display the loader and request new items on scroll. Lastly, this tutorial covers the use of Intersection Observer API for determining if a user has scrolled to the end of a list.

Demo: https://kit.radzion.com/infinite-scroll

Source code: https://github.com/radzionc/radzionkit

Accelerate your work and reach your goals faster with https://increaser.org – where deep work, time mastery, and habit shaping converge for your success! 💪🚀


Смотрите видео Infinite Scroll Component with React Query онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Radzion Dev 02 Октябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,210 раз и оно понравилось 23 людям.