fix: disable first page revalidation in useSWRInfinite (#1386)

By default, useSWRInfinite revalidates the first page every time a new page is loaded, resulting in
additional requests being sent. This PR disables this behavior.

fix #1380
This commit is contained in:
Gauthier
2025-02-22 16:46:58 +01:00
committed by GitHub
parent 117617188e
commit d563b36186
2 changed files with 2 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ const MediaSlider = ({
},
{
initialSize: 2,
revalidateFirstPage: false,
}
);

View File

@@ -80,6 +80,7 @@ const useDiscover = <
},
{
initialSize: 3,
revalidateFirstPage: false,
}
);