Update items on children state changes.

master
Hasan Genc 4 years ago
parent 8e5e7ae7ba
commit 32a7a5f180
  1. 4
      src/components/carousel/index.tsx

@ -29,6 +29,10 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
getShowArrow(props.children.length, props.show, props.infinite, current),
);
React.useEffect(() => {
setItems(initItems(props.children, props.slide, props.infinite));
}, userProps.children);
const slide = (direction: SlideDirection, slide: number): void => {
if (
animation.isSliding ||

Loading…
Cancel
Save