Skip to content

Commit d6dced3

Browse files
author
Mert Can Altin
committed
fix(carousel): type problem solved
1 parent cc24c43 commit d6dced3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/carousel/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
5555
const [page, setPage] = useState<number>(0);
5656
const isPaginating = useRef(false);
5757
const slideButtonRef = useRef<HTMLDivElement>(null);
58-
const autoSwipeTimer = useRef<NodeJS.Timeout | number>(0);
58+
const autoSwipeTimer = useRef<number>(0);
5959
const isNavigation = typeof props.navigation === 'function';
6060

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

8888
const autoSwipe = () => {
89-
clearTimeout(autoSwipeTimer.current as number);
89+
clearTimeout(autoSwipeTimer.current);
9090

9191
if (
9292
slideButtonRef &&
9393
typeof props.autoSwipe === 'number' &&
9494
props.autoSwipe > props.transition
9595
) {
96-
autoSwipeTimer.current = setTimeout(() => {
96+
autoSwipeTimer.current = window.setTimeout(() => {
9797
if (showArrow.right) {
9898
slide(SlideDirection.Right);
9999
} else {

0 commit comments

Comments
 (0)