React Query, How to perform infiniteScrolling with custom variables
I'm using
useInfiniteQuery
useInfiniteQuery
, I basically want to load as you scroll down, but I also want to load data as you select on different filters.
The way I implement it in Desktop View is using number pagination with
useQuery
useQuery
is as follows
useQuery(["key", page, showSelectedOptions])
useQuery(["key", page, showSelectedOptions])
This way when I click on the paginated number Example: Number 5 , page becomes 5 and loads new data, same thing when selected "options"
But now I wanted to do in via scroll for Mobile View, so which means the newly recieved data should not override the previous data. Currently when any of the above variable changes, the previous 5 data gets overriden by the new set of 5 items, with useQuery and with useInfiniteQuery