mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 11:59:51 +08: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);
|
const handleAsyncError = React.useContext(AsyncCallbackContext);
|
||||||
return React.useCallback(
|
return React.useCallback(
|
||||||
(...args: any) => {
|
(...args: any) => {
|
||||||
|
// oxlint-disable-next-line exhaustive-deps
|
||||||
callback(...args).catch(e => handleAsyncError(e));
|
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