Browse Source

fix: CarouselRef type (#27935)

* CarouselRef type

* fix: CarouselRef type
pull/27935/merge
Alexander Ionov 4 years ago
committed by GitHub
parent
commit
66f425c1ef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      components/carousel/index.tsx

10
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>();

Loading…
Cancel
Save