diff --git a/src/components/CarouselItem.tsx b/src/components/CarouselItem.tsx index 0470776..e95c555 100644 --- a/src/components/CarouselItem.tsx +++ b/src/components/CarouselItem.tsx @@ -65,7 +65,7 @@ export const CarouselItem = ({ animation, next, prev, swipe, state, index, maxIn }, [setHeight, state.active, index, divRef]) // Set height on every child change - useEffect(() => + useLayoutEffect(() => { checkAndSetHeight(); @@ -148,4 +148,4 @@ export const CarouselItem = ({ animation, next, prev, swipe, state, index, maxIn ) -} \ No newline at end of file +}