Skip to content

Commit

Permalink
Merge pull request #56 from thivi/main
Browse files Browse the repository at this point in the history
chore(react): fix Carousel starting with the second slide issue
  • Loading branch information
savindi7 authored Mar 2, 2023
2 parents ca8a47f + 21151b6 commit 9d370f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const COMPONENT_NAME: string = 'Carousel';

const Carousel: FC<CarouselProps> & WithWrapperProps = (props: CarouselProps): ReactElement => {
const {autoPlay, autoPlayInterval, className, nextButtonText, previousButtonText, steps, title, ...rest} = props;
const [currentStep, setCurrentStep] = useState<number>(1);
const [currentStep, setCurrentStep] = useState<number>(0);

const isLastStep: boolean = useMemo(() => currentStep === steps.length - 1, [steps, currentStep]);
const isFirstStep: boolean = useMemo(() => currentStep === 0, [currentStep]);
Expand Down

0 comments on commit 9d370f5

Please sign in to comment.