Skip to content

Commit dd30b9c

Browse files
committed
fix: modify useOffsetX viewCount default value
1 parent 48205b8 commit dd30b9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useOffsetX.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const useOffsetX = (opts: IOpts) => {
2222
loop,
2323
data,
2424
type = 'positive',
25-
viewCount = 1,
25+
viewCount = Math.round((data.length - 1) / 2),
2626
} = opts;
2727
const ITEM_LENGTH = data.length;
2828
const VALID_LENGTH = ITEM_LENGTH - 1;

0 commit comments

Comments
 (0)