Skip to content

Commit

Permalink
fix: fixed failure to set default values
Browse files Browse the repository at this point in the history
  • Loading branch information
dohooo committed Dec 19, 2021
1 parent 3796359 commit 5d02779
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function Carousel<T>(
const handlerOffsetX = useSharedValue<number>(defaultHandlerOffsetX);

React.useEffect(() => {
handlerOffsetX.value = 0;
}, [vertical, handlerOffsetX]);
handlerOffsetX.value = defaultHandlerOffsetX;
}, [vertical, handlerOffsetX, defaultHandlerOffsetX]);

const data = React.useMemo<T[]>(() => {
if (!loop) return _data;
Expand Down

0 comments on commit 5d02779

Please sign in to comment.