diff --git a/packages/vkui/src/components/Gallery/hooks.ts b/packages/vkui/src/components/Gallery/hooks.ts index d90f3faad9..b1222f6c4b 100644 --- a/packages/vkui/src/components/Gallery/hooks.ts +++ b/packages/vkui/src/components/Gallery/hooks.ts @@ -1,3 +1,4 @@ +import { useCallback } from 'react'; import * as React from 'react'; import { useStableCallback } from '../../hooks/useStableCallback'; import { useDOM } from '../../lib/dom'; @@ -18,8 +19,8 @@ export function useAutoPlay({ timeout, slideIndex, onNext }: AutoPlayConfig): { const timeoutRef = React.useRef(null); const callbackFn = useStableCallback(onNext); - const pause = useStableCallback(() => setPaused(true)); - const resume = useStableCallback(() => setPaused(false)); + const pause = useCallback(() => setPaused(true), []); + const resume = useCallback(() => setPaused(false), []); // Выносим функции очистки и старта таймера в отдельные функции const clearAutoPlayTimeout = React.useCallback(() => {