From 66f425c1ef7824c635b423c61c6ddf8b0378f8c6 Mon Sep 17 00:00:00 2001 From: Alexander Ionov Date: Mon, 23 Nov 2020 06:08:24 +0400 Subject: [PATCH] fix: CarouselRef type (#27935) * CarouselRef type * fix: CarouselRef type --- components/carousel/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index 8da2e24a16..5984f8ced0 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -22,7 +22,15 @@ export interface CarouselProps extends Omit { }; } -const Carousel = React.forwardRef( +export interface CarouselRef { + goTo: (slide: number, dontAnimate: boolean) => void; + next: () => void; + prev: () => void; + autoPlay: boolean; + innerSlider: any; +} + +const Carousel = React.forwardRef( ({ dots = true, arrows = false, draggable = false, dotPosition = 'bottom', ...props }, ref) => { const { getPrefixCls, direction } = React.useContext(ConfigContext); const slickRef = React.useRef();