Skip to content

Commit

Permalink
fix: add *length and remove *data from deps
Browse files Browse the repository at this point in the history
  • Loading branch information
KusStar committed Mar 30, 2022
1 parent 54e74d2 commit fbfd372
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Carousel = React.forwardRef<ICarouselInstance, TCarouselProps<any>>(
return handlerOffsetX.value;
}
return isNaN(x) ? 0 : x;
}, [loop, size, data]);
}, [loop, size, dataLength]);

usePropsErrorBoundary(props);
useOnProgressChange({ size, offsetX, rawData, onProgressChange });
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useOnProgressChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export function useOnProgressChange(
!!onProgressChange &&
runOnJS(onProgressChange)(value, absoluteProgress);
},
[onProgressChange, rawData]
[onProgressChange, rawDataLength]
);
}

0 comments on commit fbfd372

Please sign in to comment.