You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

use-pagination.js 321B

12345678910
  1. import { useQuery } from '@tanstack/react-query';
  2. import { getData } from '../requests/dataRequest';
  3. export const usePagination = (activePage) => {
  4. return useQuery(['randomData', activePage], () => getData(activePage), {
  5. keepPreviousData: true,
  6. refetchOnMount: false,
  7. refetchOnWindowFocus: false,
  8. });
  9. };