diff --git a/packages/mui-utils/src/useEventCallback/useEventCallback.ts b/packages/mui-utils/src/useEventCallback/useEventCallback.ts index 398945443adc90..f81e1a23759a2e 100644 --- a/packages/mui-utils/src/useEventCallback/useEventCallback.ts +++ b/packages/mui-utils/src/useEventCallback/useEventCallback.ts @@ -19,13 +19,11 @@ function useEventCallback( useEnhancedEffect(() => { ref.current = fn; }); - return React.useCallback( - (...args: Args) => - // @ts-expect-error hide `this` - // tslint:disable-next-line:ban-comma-operator - (0, ref.current!)(...args), - [], - ); + return React.useRef((...args: Args) => + // @ts-expect-error hide `this` + // tslint:disable-next-line:ban-comma-operator + (0, ref.current!)(...args), + ).current; } export default useEventCallback;