Skip to content

Commit 4f0b917

Browse files
fix: Added missing dependencies for web to work (#775)
1 parent 50b0a5b commit 4f0b917

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/components/CarouselLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const CarouselLayout = React.forwardRef<ICarouselInstance>((_props, ref)
6262
if (!loop) return handlerOffset.value;
6363

6464
return Number.isNaN(x) ? 0 : x;
65-
}, [loop, size, dataLength]);
65+
}, [loop, size, dataLength, handlerOffset]);
6666

6767
useOnProgressChange({
6868
autoFillData,

src/components/ItemLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const ItemLayout: React.FC<{
5858
const animationValue = useDerivedValue(() => x.value / size, [x, size]);
5959
const animatedStyle = useAnimatedStyle<ViewStyle>(
6060
() => animationStyle(x.value / size, index),
61-
[animationStyle, index]
61+
[animationStyle, index, x, size]
6262
);
6363

6464
// TODO: For dynamic dimension in the future

src/hooks/useOffsetX.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const useOffsetX = (opts: IOpts, visibleRanges: IVisibleRanges) => {
7373
}
7474

7575
return Number.MAX_SAFE_INTEGER;
76-
}, [loop, dataLength, viewCount, type, size, visibleRanges]);
76+
}, [loop, dataLength, viewCount, type, size, visibleRanges, handlerOffset]);
7777

7878
return x;
7979
};

0 commit comments

Comments
 (0)