Browse Source
fix: CarouselRef type (#27935)
* CarouselRef type
* fix: CarouselRef type
pull/27935/merge
Alexander Ionov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
1 deletions
-
components/carousel/index.tsx
|
|
@ -22,7 +22,15 @@ export interface CarouselProps extends Omit<Settings, 'dots' | 'dotsClass'> { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
const Carousel = React.forwardRef<unknown, CarouselProps>( |
|
|
|
export interface CarouselRef { |
|
|
|
goTo: (slide: number, dontAnimate: boolean) => void; |
|
|
|
next: () => void; |
|
|
|
prev: () => void; |
|
|
|
autoPlay: boolean; |
|
|
|
innerSlider: any; |
|
|
|
} |
|
|
|
|
|
|
|
const Carousel = React.forwardRef<CarouselRef, CarouselProps>( |
|
|
|
({ dots = true, arrows = false, draggable = false, dotPosition = 'bottom', ...props }, ref) => { |
|
|
|
const { getPrefixCls, direction } = React.useContext(ConfigContext); |
|
|
|
const slickRef = React.useRef<any>(); |
|
|
|