Skip to content

Commit

Permalink
fix: fix bug with windowSize props
Browse files Browse the repository at this point in the history
fix #71
  • Loading branch information
dohooo committed Jan 4, 2022
1 parent f24ee1a commit 8a048df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/hooks/useVisibleRanges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export function useVisibleRanges(options: {
windowSize?: number;
translation: Animated.SharedValue<number>;
}): IVisibleRanges {
const { total, viewSize, windowSize = 0, translation } = options;
const {
total = 0,
viewSize,
translation,
windowSize: _windowSize = 0,
} = options;

const windowSize = total <= _windowSize ? total : _windowSize;

const ranges = useDerivedValue(() => {
const positiveCount = Math.round(windowSize / 2);
Expand Down

0 comments on commit 8a048df

Please sign in to comment.