Yuken Tezuka 3 лет назад
Родитель
Сommit
6462da8b87
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      packages/app/src/stores/use-context-swr.tsx

+ 3 - 4
packages/app/src/stores/use-context-swr.tsx

@@ -18,8 +18,7 @@ export function useContextSWR<Data, Error>(
 
 
   const swrResponse = useStaticSWR<Data, Error>(key, data, configuration);
   const swrResponse = useStaticSWR<Data, Error>(key, data, configuration);
 
 
-  return {
-    ...swrResponse,
-    mutate: () => { throw Error('mutate can not be used in context') },
-  };
+  const result = Object.assign(swrResponse, { mutate: () => { throw Error('mutate can not be used in context') } });
+
+  return result;
 }
 }