mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix(swr): prevent useActionSWR isValidating from getting stuck (#12059)
This commit is contained in:
@@ -66,6 +66,10 @@ export const useActionSWR: SWRHook = (key, fetch, config) =>
|
||||
fallbackData: {},
|
||||
refreshWhenHidden: false,
|
||||
refreshWhenOffline: false,
|
||||
// If we disable `revalidateOnMount` but keep `revalidateIfStale` enabled (default true),
|
||||
// SWR can infer `isValidating=true` on subsequent renders while never actually starting a request.
|
||||
// This will lock action buttons in loading state.
|
||||
revalidateIfStale: false,
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnMount: false,
|
||||
revalidateOnReconnect: false,
|
||||
|
||||
Reference in New Issue
Block a user