message: [HorizontalScroll] Fix scroll animation recursion
diff: -import React, { FunctionComponent, HTMLAttributes, useRef, useEffect, useState, useCallback } from 'react';
  +import React, { HTMLAttributes, useRef, useEffect, useState, useCallback, FC } from 'react';
  import classNames from '../../lib/classNames';
  import { hasMouse } from '@vkontakte/vkjs/lib/InputUtils';
  import Icon24Chevron from '@vkontakte/icons/dist/24/chevron_right';
  @@ -8,7 +8,7 @@ import getClassName from '../../helpers/getClassName';
  type GetScrollPositionCallback = (currentPosition: number) => number;
  type Callback = () => void;
  type ScrollContext = {
  - scrollElement: HTMLElement;
  + scrollElement: HTMLElement | null;
  scrollAnimationDuration: number;
  animationQueue: Callback[];
  getScrollPosition: GetScrollPositionCallback;
  @@ -101,7 +101,7 @@ function doScroll({
  const currentLeft = startLeft + (endLeft - startLeft) * value;
  scrollElement.scrollLeft = Math.ceil(currentLeft);
  - if (scrollElement.scrollLeft !== endLeft) {
  + if (scrollElement.scrollLeft !== Math.max(0, endLeft)) {
  requestAnimationFrame(scroll);
  return;
  }
  @@ -114,7 +114,7 @@ function doScroll({
  })();
  }
  -const HorizontalScrollArrow: FunctionComponent<HorizontalScrollArrowProps> = (props: HorizontalScrollArrowProps) => {
  +const HorizontalScrollArrow: FC<HorizontalScrollArrowProps> = (props) => {
  const { onClick, direction } = props;
  return (
  <div className={`HorizontalScroll__arrow HorizontalScroll__arrow-${direction}`} onClick={onClick}>
  @@ -125,7 +125,7 @@ const HorizontalScrollArrow: FunctionComponent<HorizontalScrollArrowProps> = (pr
  );
  };
  -const HorizontalScroll: FunctionComponent<HorizontalScrollProps> = (props: HorizontalScrollProps) => {
  +const HorizontalScroll: FC<HorizontalScrollProps> = (props) => {
  const { children, getScrollToLeft, getScrollToRight, showArrows = false, scrollAnimationDuration, className, ...restProps } = props;
  const [canScrollLeft, setCanScrollLeft] = useState(false);
  