Skip to content

Commit cb2bef4

Browse files
committed
fix: ensure useOnProgressChange responds to new offsetX instance
Passing new offsetX instance to useOnProgressChange hook would not cause useAnimatedReaction hook to re-run despite it using that value. Adding this shared value as a dependency of the hook.
1 parent 43a4c08 commit cb2bef4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/cyan-points-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-native-reanimated-carousel": patch
3+
---
4+
5+
Adding `offsetX` as internal dependency of useOnProgressChange to ensure reactivity

src/hooks/useOnProgressChange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ export function useOnProgressChange(
4545
else onProgressChange.value = absoluteProgress;
4646
}
4747
},
48-
[loop, autoFillData, rawDataLength, onProgressChange, size]
48+
[loop, autoFillData, rawDataLength, onProgressChange, size, offsetX]
4949
);
5050
}

0 commit comments

Comments
 (0)