Skip to content

Commit

Permalink
fix(carousel): type problem solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Mert Can Altin committed Sep 3, 2024
1 parent cc24c43 commit d6dced3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
const [page, setPage] = useState<number>(0);
const isPaginating = useRef(false);
const slideButtonRef = useRef<HTMLDivElement>(null);
const autoSwipeTimer = useRef<NodeJS.Timeout | number>(0);
const autoSwipeTimer = useRef<number>(0);
const isNavigation = typeof props.navigation === 'function';

if (props.dynamic) {
Expand Down Expand Up @@ -86,14 +86,14 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
}, []);

const autoSwipe = () => {
clearTimeout(autoSwipeTimer.current as number);
clearTimeout(autoSwipeTimer.current);

if (
slideButtonRef &&
typeof props.autoSwipe === 'number' &&
props.autoSwipe > props.transition
) {
autoSwipeTimer.current = setTimeout(() => {
autoSwipeTimer.current = window.setTimeout(() => {
if (showArrow.right) {
slide(SlideDirection.Right);
} else {
Expand Down

0 comments on commit d6dced3

Please sign in to comment.