🐛 fix(swr): prevent useActionSWR isValidating from getting stuck (#12059)

This commit is contained in:
Kingsword
2026-02-09 09:57:37 +08:00
committed by GitHub
parent dd7d590bdd
commit 8877bc12d7

View File

@@ -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,