mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 08:38:34 +00:00
fix(core): infinitied loop
This commit is contained in:
@@ -22,8 +22,9 @@ export function useAsyncCallback<T extends any[]>(
|
||||
const handleAsyncError = React.useContext(AsyncCallbackContext);
|
||||
return React.useCallback(
|
||||
(...args: any) => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
callback(...args).catch(e => handleAsyncError(e));
|
||||
},
|
||||
[callback, handleAsyncError, ...deps] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
[...deps] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user