From e1a16ca44b4fb8e3e0298cfc3d30eb71b143e668 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Mon, 30 Aug 2021 01:43:42 +0100 Subject: [PATCH] add initial value to useStaleSWR --- utils/tools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/tools.ts b/utils/tools.ts index 53118ae..394b716 100644 --- a/utils/tools.ts +++ b/utils/tools.ts @@ -27,7 +27,7 @@ const fetcher = (url: string, token: string) => * @param url request url * @returns useSWR instance */ -export const useStaleSWR = (url: Key, path: string) => { +export const useStaleSWR = (url: Key, path: string = '') => { const revalidationOptions = { revalidateOnMount: !cache.has(url), revalidateOnFocus: false,