Răsfoiți Sursa

modify swr configuration

Yuki Takei 4 ani în urmă
părinte
comite
8250b2296b

+ 3 - 2
packages/app/src/stores/use-static-swr.tsx

@@ -1,6 +1,7 @@
-import useSWR, {
+import {
   Key, SWRConfiguration, SWRResponse, mutate,
 } from 'swr';
+import useSWRImmutable from 'swr/immutable';
 import { Fetcher } from 'swr/dist/types';
 
 
@@ -21,5 +22,5 @@ export function useStaticSWR<Data, Error>(
     mutate(key, fetcherFixed);
   }
 
-  return useSWR(key, null, configuration);
+  return useSWRImmutable(key, null, configuration);
 }

+ 0 - 1
packages/app/src/utils/swr-utils.ts

@@ -1,6 +1,5 @@
 import { SWRConfiguration } from 'swr';
 
 export const swrGlobalConfiguration: SWRConfiguration = {
-  revalidateOnFocus: false,
   errorRetryCount: 1,
 };