Skip to content

Commit

Permalink
fix: dependency array; removes shared value access warning from react…
Browse files Browse the repository at this point in the history
…-native-reanimated (#710)

* fix: dependency array in ScrollViewGesture activeDecay should not include .value; orig was eb21293

* fix: dependency array in ScrollViewGesture resetBoundary should not include .value; orig was eb21293

* chore: npx changeset
  • Loading branch information
nmassey authored Nov 23, 2024
1 parent 2c2a8e2 commit d98bb99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-insects-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-native-reanimated-carousel": patch
---

fix: remove shared value access warning from react-native-reanimated
6 changes: 3 additions & 3 deletions src/components/ScrollViewGesture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const IScrollViewGesture: React.FC<PropsWithChildren<Props>> = (props) => {
{ velocity: scrollEndVelocity.value },
isFinished => onFinish(isFinished as boolean),
);
}, [onFinish, scrollEndVelocity.value, touching, translation]);
}, [onFinish, scrollEndVelocity, touching, translation]);

const resetBoundary = React.useCallback(() => {
"worklet";
Expand All @@ -232,11 +232,11 @@ const IScrollViewGesture: React.FC<PropsWithChildren<Props>> = (props) => {
translation.value = withSpring(-((maxPage - 1) * size));
}
}, [
touching.value,
touching,
translation,
maxPage,
size,
scrollEndTranslation.value,
scrollEndTranslation,
loop,
activeDecay,
withSpring,
Expand Down

0 comments on commit d98bb99

Please sign in to comment.