From cfa70af489981378b0708970335476e226102bea Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Tue, 5 Dec 2023 23:07:00 +0530 Subject: [PATCH] Eliminate revalidation cache on focus to enhance the fluidity of optimistic updates --- components/Feed.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Feed.tsx b/components/Feed.tsx index 01b030f..cce1ff6 100644 --- a/components/Feed.tsx +++ b/components/Feed.tsx @@ -29,7 +29,7 @@ export default function Feed({ type }) { const key = type ? `${backendUrl}/posts?type=${type}` : `${backendUrl}/posts`; const { data, error, isLoading, mutate } = useSWR(key, fetcher, { // refreshInterval: 30000, - revalidateOnFocus: true, + revalidateOnFocus: false, revalidateOnReconnect: true, refreshWhenOffline: true, });