#Pagination and searching together

5 messages · Page 1 of 1 (latest)

vocal crane
#

Hi, amazing library. I'm looking for a way to achieve both pagination and searching together (with caching features of react query, of course) but I couldn't find a specific example since my usage is also specific. What is the most used pattern for such task or are there any resources you recommend?

tawny parrot
#
  • current page goes into the queryKey
  • filters go into the queryKey

there is nothing special about that combination

vocal crane
#

as far as I understood, useQuery acts like useEffect and reruns the query when queryKeys are updated

tawny parrot
#

yep