mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
chore(carousel): code optimization (#49484)
This commit is contained in:
parent
f910b5678e
commit
e9cc7c1ec0
@ -31,14 +31,16 @@ export interface CarouselRef {
|
||||
innerSlider: any;
|
||||
}
|
||||
|
||||
interface ArrowType extends React.ButtonHTMLAttributes<HTMLElement> {
|
||||
interface ArrowType extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
currentSlide?: number;
|
||||
slideCount?: number;
|
||||
}
|
||||
|
||||
function ArrowButton({ currentSlide, slideCount, ...rest }: ArrowType) {
|
||||
return <button type="button" {...rest} />;
|
||||
}
|
||||
const ArrowButton: React.FC<ArrowType> = ({ currentSlide, slideCount, ...rest }) => (
|
||||
<button type="button" {...rest} />
|
||||
);
|
||||
|
||||
const dotsClass = 'slick-dots';
|
||||
|
||||
const Carousel = React.forwardRef<CarouselRef, CarouselProps>((props, ref) => {
|
||||
const {
|
||||
@ -96,7 +98,6 @@ const Carousel = React.forwardRef<CarouselRef, CarouselProps>((props, ref) => {
|
||||
}
|
||||
|
||||
const prefixCls = getPrefixCls('carousel', newProps.prefixCls);
|
||||
const dotsClass = 'slick-dots';
|
||||
|
||||
const enableDots = !!dots;
|
||||
const dsClass = classNames(
|
||||
|
Loading…
Reference in New Issue
Block a user