mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
🐛 fix(swr): prevent useActionSWR isValidating from getting stuck (#12059)
This commit is contained in:
parent
dd7d590bdd
commit
8877bc12d7
1 changed files with 4 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue